home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 1999 August / SGI Freeware 1999 August.iso / dist / fw_libtool.idb / usr / freeware / bin / libtool.z / libtool
Encoding:
Text File  |  1999-07-16  |  113.2 KB  |  4,154 lines

  1. #! /bin/sh
  2.  
  3. # libtool - Provide generalized library-building support services.
  4. # Generated automatically by ltconfig (GNU libtool 1.3.2 (1.385.2.150 1999/05/26 00:28:32))
  5. # NOTE: Changes made to this file will be lost: look at ltconfig or ltmain.sh.
  6. #
  7. # Copyright (C) 1996-1999 Free Software Foundation, Inc.
  8. # Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
  9. #
  10. # This program is free software; you can redistribute it and/or modify
  11. # it under the terms of the GNU General Public License as published by
  12. # the Free Software Foundation; either version 2 of the License, or
  13. # (at your option) any later version.
  14. #
  15. # This program is distributed in the hope that it will be useful, but
  16. # WITHOUT ANY WARRANTY; without even the implied warranty of
  17. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  18. # General Public License for more details.
  19. #
  20. # You should have received a copy of the GNU General Public License
  21. # along with this program; if not, write to the Free Software
  22. # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  23. #
  24. # As a special exception to the GNU General Public License, if you
  25. # distribute this file as part of a program that contains a
  26. # configuration script generated by Autoconf, you may include it under
  27. # the same distribution terms that you use for the rest of that program.
  28.  
  29. # Sed that helps us avoid accidentally triggering echo(1) options like -n.
  30. Xsed="sed -e s/^X//"
  31.  
  32. # The HP-UX ksh and POSIX shell print the target directory to stdout
  33. # if CDPATH is set.
  34. if test "${CDPATH+set}" = set; then CDPATH=; export CDPATH; fi
  35.  
  36. ### BEGIN LIBTOOL CONFIG
  37. # Libtool was configured as follows, on host humu:
  38. #
  39. # CC="sgifwcompile -e -nostdinc -I. -I${ROOT}/usr/freeware/include  -I${ROOT}/usr/include -O3 -OPT:Olimit=0:space=ON -n32 -mips3 -nostdlib -L${ROOT}/usr/freeware/lib32  -L${ROOT}/usr/lib32 -woff 1009,1014,1048,1107,1110,1116,1164,1185,1188,1204,1230,1233  -Wl,-woff,85,-woff,84 -rpath /usr/freeware/lib32 -- ${TOOLROOT}/usr/bin/cc" CFLAGS="" CPPFLAGS="" \
  40. # LD="${TOOLROOT}/bin/ld -n32" LDFLAGS="-n32 -mips3 -nostdlib -L${ROOT}/usr/freeware/lib32  -L${ROOT}/usr/lib32 -woff 1009,1014,1048,1107,1110,1116,1164,1185,1188,1204,1230,1233  -Wl,-woff,85,-woff,84 -rpath /usr/freeware/lib32" LIBS="" \
  41. # NM="${TOOLROOT}/bin/nm -B" RANLIB=":" LN_S="ln -s" \
  42. # DLLTOOL="" OBJDUMP="" AS="" \
  43. #   ./ltconfig --cache-file=./config.cache --enable-dlopen --srcdir=. --output=libtool ./ltmain.sh
  44. #
  45. # Compiler and other test output produced by ltconfig, useful for
  46. # debugging ltconfig, is in ./config.log if it exists.
  47.  
  48. # The version of ltconfig that generated this script.
  49. LTCONFIG_VERSION="1.3.2"
  50.  
  51. # Shell to use when invoking shell scripts.
  52. SHELL="/bin/sh"
  53.  
  54. # Whether or not to build shared libraries.
  55. build_libtool_libs=yes
  56.  
  57. # Whether or not to build static libraries.
  58. build_old_libs=yes
  59.  
  60. # Whether or not to optimize for fast installation.
  61. fast_install=yes
  62.  
  63. # The host system.
  64. host_alias=mips-sgi-irix6.2
  65. host=mips-sgi-irix6.2
  66.  
  67. # An echo program that does not interpret backslashes.
  68. echo="print -r"
  69.  
  70. # The archiver.
  71. AR="ar"
  72.  
  73. # The default C compiler.
  74. CC="${TOOLROOT}/usr/bin/cc"
  75.  
  76. # The linker used to build libraries.
  77. LD="${TOOLROOT}/bin/ld ${ABIARCH- -n32}"
  78.  
  79. # Whether we need hard or soft links.
  80. LN_S="ln -s"
  81.  
  82. # A BSD-compatible nm program.
  83. NM="${TOOLROOT}/bin/nm -B"
  84.  
  85. # Used on cygwin: DLL creation program.
  86. DLLTOOL="dlltool"
  87.  
  88. # Used on cygwin: object dumper.
  89. OBJDUMP="objdump"
  90.  
  91. # Used on cygwin: assembler.
  92. AS="as"
  93.  
  94. # The name of the directory that contains temporary libtool files.
  95. objdir=.libs
  96.  
  97. # How to create reloadable object files.
  98. reload_flag=" -r"
  99. reload_cmds="\$LD\$reload_flag -o \$output\$reload_objs"
  100.  
  101. # How to pass a linker flag through the compiler.
  102. wl="-Wl,"
  103.  
  104. # Object file suffix (normally "o").
  105. objext="o"
  106.  
  107. # Old archive suffix (normally "a").
  108. libext="a"
  109.  
  110. # Additional compiler flags for building library objects.
  111. pic_flag=""
  112.  
  113. # Does compiler simultaneously support -c and -o options?
  114. compiler_c_o="yes"
  115.  
  116. # Can we write directly to a .lo ?
  117. compiler_o_lo="yes"
  118.  
  119. # Must we lock files when doing compilation ?
  120. need_locks="no"
  121.  
  122. # Do we need the lib prefix for modules?
  123. need_lib_prefix=no
  124.  
  125. # Do we need a version for libraries?
  126. need_version=no
  127.  
  128. # Whether dlopen is supported.
  129. dlopen=yes
  130.  
  131. # Whether dlopen of programs is supported.
  132. dlopen_self=yes
  133.  
  134. # Whether dlopen of statically linked programs is supported.
  135. dlopen_self_static=yes
  136.  
  137. # Compiler flag to prevent dynamic linking.
  138. link_static_flag=""
  139.  
  140. # Compiler flag to turn off builtin functions.
  141. no_builtin_flag=""
  142.  
  143. # Compiler flag to allow reflexive dlopens.
  144. export_dynamic_flag_spec=""
  145.  
  146. # Compiler flag to generate shared objects directly from archives.
  147. whole_archive_flag_spec=""
  148.  
  149. # Compiler flag to generate thread-safe objects.
  150. thread_safe_flag_spec=""
  151.  
  152. # Library versioning type.
  153. version_type=irix
  154.  
  155. # Format of library name prefix.
  156. libname_spec="lib\$name"
  157.  
  158. # List of archive names.  First name is the real one, the rest are links.
  159. # The last name is the one that the linker finds with -lNAME.
  160. library_names_spec="\${libname}\${release}.so.\$versuffix \${libname}\${release}.so.\$major \${libname}\${release}.so \$libname.so"
  161.  
  162. # The coded name of the library, if different from the real name.
  163. soname_spec="\${libname}\${release}.so.\$major"
  164.  
  165. # Commands used to build and install an old-style archive.
  166. RANLIB=":"
  167. old_archive_cmds="\$AR cru \$oldlib\$oldobjs~\$RANLIB \$oldlib"
  168. old_postinstall_cmds="\$RANLIB \$oldlib~chmod 644 \$oldlib"
  169. old_postuninstall_cmds=""
  170.  
  171. # Create an old-style archive from a shared archive.
  172. old_archive_from_new_cmds=""
  173.  
  174. # Commands used to build and install a shared archive.
  175. archive_cmds="\$LD -shared \$libobjs \$deplibs \$linkopts -soname \$soname \\\`test -n \\\"\$verstring\\\" && echo -set_version \$verstring\\\` -update_registry \${objdir}/so_locations -o \$lib"
  176. archive_expsym_cmds=""
  177. postinstall_cmds=""
  178. postuninstall_cmds=""
  179.  
  180. # Method to check whether dependent libraries are shared objects.
  181. deplibs_check_method="pass_all"
  182.  
  183. # Command to use when deplibs_check_method == file_magic.
  184. file_magic_cmd="/usr/bin/file"
  185.  
  186. # Flag that allows shared libraries with undefined symbols to be built.
  187. allow_undefined_flag=""
  188.  
  189. # Flag that forces no undefined symbols.
  190. no_undefined_flag=""
  191.  
  192. # Commands used to finish a libtool library installation in a directory.
  193. finish_cmds=""
  194.  
  195. # Same as above, but a single script fragment to be evaled but not shown.
  196. finish_eval=""
  197.  
  198. # Take the output of nm and produce a listing of raw symbols and C names.
  199. global_symbol_pipe="sed -n -e 's/^.*[     ]\\([BCDEGRST]\\)[     ][     ]*\\(\\)\\([_A-Za-z][_A-Za-z0-9]*\\)\$/\\1 \\2\\3 \\3/p'"
  200.  
  201. # Transform the output of nm in a proper C declaration
  202. global_symbol_to_cdecl="sed -n -e 's/^. .* \\(.*\\)\$/extern char \\1;/p'"
  203.  
  204. # This is the shared library runtime path variable.
  205. runpath_var=
  206.  
  207. # This is the shared library path variable.
  208. shlibpath_var=${ABILIBPATHVAR-LD_LIBRARYN32_PATH}
  209.  
  210. # Is shlibpath searched before the hard-coded library search path?
  211. shlibpath_overrides_runpath=no
  212.  
  213. # How to hardcode a shared library path into an executable.
  214. hardcode_action=immediate
  215.  
  216. # Flag to hardcode $libdir into a binary during linking.
  217. # This must work even if $libdir does not exist.
  218. hardcode_libdir_flag_spec="\${wl}-rpath \${wl}\$libdir"
  219.  
  220. # Whether we need a single -rpath flag with a separated argument.
  221. hardcode_libdir_separator=":"
  222.  
  223. # Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the
  224. # resulting binary.
  225. hardcode_direct=no
  226.  
  227. # Set to yes if using the -LDIR flag during linking hardcodes DIR into the
  228. # resulting binary.
  229. hardcode_minus_L=no
  230.  
  231. # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
  232. # the resulting binary.
  233. hardcode_shlibpath_var=unsupported
  234.  
  235. # Compile-time system search path for libraries
  236. sys_lib_search_path_spec="/usr/lib32 /lib32 /usr/local/lib32"
  237.  
  238. # Run-time system search path for libraries
  239. sys_lib_dlsearch_path_spec="/usr/lib32 /lib32"
  240.  
  241. # Fix the shell variable $srcfile for the compiler.
  242. fix_srcfile_path=""
  243.  
  244. # Set to yes if exported symbols are required.
  245. always_export_symbols=no
  246.  
  247. # The commands to list exported symbols.
  248. export_symbols_cmds="\$NM \$libobjs | \$global_symbol_pipe | sed 's/.* //' | sort | uniq > \$export_symbols"
  249.  
  250. # Symbols that should not be listed in the preloaded symbols.
  251. exclude_expsyms="_GLOBAL_OFFSET_TABLE_"
  252.  
  253. # Symbols that must always be exported.
  254. include_expsyms=""
  255.  
  256. ### END LIBTOOL CONFIG
  257.  
  258. # ltmain.sh - Provide generalized library-building support services.
  259. # NOTE: Changing this file will not affect anything until you rerun ltconfig.
  260. #
  261. # Copyright (C) 1996-1999 Free Software Foundation, Inc.
  262. # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
  263. #
  264. # This program is free software; you can redistribute it and/or modify
  265. # it under the terms of the GNU General Public License as published by
  266. # the Free Software Foundation; either version 2 of the License, or
  267. # (at your option) any later version.
  268. #
  269. # This program is distributed in the hope that it will be useful, but
  270. # WITHOUT ANY WARRANTY; without even the implied warranty of
  271. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  272. # General Public License for more details.
  273. #
  274. # You should have received a copy of the GNU General Public License
  275. # along with this program; if not, write to the Free Software
  276. # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  277. #
  278. # As a special exception to the GNU General Public License, if you
  279. # distribute this file as part of a program that contains a
  280. # configuration script generated by Autoconf, you may include it under
  281. # the same distribution terms that you use for the rest of that program.
  282.  
  283. # Check that we have a working $echo.
  284. if test "X$1" = X--no-reexec; then
  285.   # Discard the --no-reexec flag, and continue.
  286.   shift
  287. elif test "X$1" = X--fallback-echo; then
  288.   # Avoid inline document here, it may be left over
  289.   :
  290. elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
  291.   # Yippee, $echo works!
  292.   :
  293. else
  294.   # Restart under the correct shell, and then maybe $echo will work.
  295.   exec $SHELL "$0" --no-reexec ${1+"$@"}
  296. fi
  297.  
  298. if test "X$1" = X--fallback-echo; then
  299.   # used as fallback echo
  300.   shift
  301.   cat <<EOF
  302. $*
  303. EOF
  304.   exit 0
  305. fi
  306.  
  307. # The name of this program.
  308. progname=`$echo "$0" | sed 's%^.*/%%'`
  309. modename="$progname"
  310.  
  311. # Constants.
  312. PROGRAM=ltmain.sh
  313. PACKAGE=libtool
  314. VERSION=1.3.2
  315. TIMESTAMP=" (1.385.2.150 1999/05/26 00:28:32)"
  316.  
  317. default_mode=
  318. help="Try \`$progname --help' for more information."
  319. magic="%%%MAGIC variable%%%"
  320. mkdir="mkdir"
  321. mv="mv -f"
  322. rm="rm -f"
  323.  
  324. # Sed substitution that helps us do robust quoting.  It backslashifies
  325. # metacharacters that are still active within double-quoted strings.
  326. Xsed='sed -e 1s/^X//'
  327. sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
  328. SP2NL='tr \040 \012'
  329. NL2SP='tr \012 \040'
  330.  
  331. # NLS nuisances.
  332. # Only set LANG and LC_ALL to C if already set.
  333. # These must not be set unconditionally because not all systems understand
  334. # e.g. LANG=C (notably SCO).
  335. # We save the old values to restore during execute mode.
  336. if test "${LC_ALL+set}" = set; then
  337.   save_LC_ALL="$LC_ALL"; LC_ALL=C; export LC_ALL
  338. fi
  339. if test "${LANG+set}" = set; then
  340.   save_LANG="$LANG"; LANG=C; export LANG
  341. fi
  342.  
  343. if test "$LTCONFIG_VERSION" != "$VERSION"; then
  344.   echo "$modename: ltconfig version \`$LTCONFIG_VERSION' does not match $PROGRAM version \`$VERSION'" 1>&2
  345.   echo "Fatal configuration error.  See the $PACKAGE docs for more information." 1>&2
  346.   exit 1
  347. fi
  348.  
  349. if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
  350.   echo "$modename: not configured to build any kind of library" 1>&2
  351.   echo "Fatal configuration error.  See the $PACKAGE docs for more information." 1>&2
  352.   exit 1
  353. fi
  354.  
  355. # Global variables.
  356. mode=$default_mode
  357. nonopt=
  358. prev=
  359. prevopt=
  360. run=
  361. show="$echo"
  362. show_help=
  363. execute_dlfiles=
  364. lo2o="s/\\.lo\$/.${objext}/"
  365. o2lo="s/\\.${objext}\$/.lo/"
  366.  
  367. # Parse our command line options once, thoroughly.
  368. while test $# -gt 0
  369. do
  370.   arg="$1"
  371.   shift
  372.  
  373.   case "$arg" in
  374.   -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
  375.   *) optarg= ;;
  376.   esac
  377.  
  378.   # If the previous option needs an argument, assign it.
  379.   if test -n "$prev"; then
  380.     case "$prev" in
  381.     execute_dlfiles)
  382.       eval "$prev=\"\$$prev \$arg\""
  383.       ;;
  384.     *)
  385.       eval "$prev=\$arg"
  386.       ;;
  387.     esac
  388.  
  389.     prev=
  390.     prevopt=
  391.     continue
  392.   fi
  393.  
  394.   # Have we seen a non-optional argument yet?
  395.   case "$arg" in
  396.   --help)
  397.     show_help=yes
  398.     ;;
  399.  
  400.   --version)
  401.     echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
  402.     exit 0
  403.     ;;
  404.  
  405.   --config)
  406.     sed -e '1,/^### BEGIN LIBTOOL CONFIG/d' -e '/^### END LIBTOOL CONFIG/,$d' $0
  407.     exit 0
  408.     ;;
  409.  
  410.   --debug)
  411.     echo "$progname: enabling shell trace mode"
  412.     set -x
  413.     ;;
  414.  
  415.   --dry-run | -n)
  416.     run=:
  417.     ;;
  418.  
  419.   --features)
  420.     echo "host: $host"
  421.     if test "$build_libtool_libs" = yes; then
  422.       echo "enable shared libraries"
  423.     else
  424.       echo "disable shared libraries"
  425.     fi
  426.     if test "$build_old_libs" = yes; then
  427.       echo "enable static libraries"
  428.     else
  429.       echo "disable static libraries"
  430.     fi
  431.     exit 0
  432.     ;;
  433.  
  434.   --finish) mode="finish" ;;
  435.  
  436.   --mode) prevopt="--mode" prev=mode ;;
  437.   --mode=*) mode="$optarg" ;;
  438.  
  439.   --quiet | --silent)
  440.     show=:
  441.     ;;
  442.  
  443.   -dlopen)
  444.     prevopt="-dlopen"
  445.     prev=execute_dlfiles
  446.     ;;
  447.  
  448.   -*)
  449.     $echo "$modename: unrecognized option \`$arg'" 1>&2
  450.     $echo "$help" 1>&2
  451.     exit 1
  452.     ;;
  453.  
  454.   *)
  455.     nonopt="$arg"
  456.     break
  457.     ;;
  458.   esac
  459. done
  460.  
  461. if test -n "$prevopt"; then
  462.   $echo "$modename: option \`$prevopt' requires an argument" 1>&2
  463.   $echo "$help" 1>&2
  464.   exit 1
  465. fi
  466.  
  467. if test -z "$show_help"; then
  468.  
  469.   # Infer the operation mode.
  470.   if test -z "$mode"; then
  471.     case "$nonopt" in
  472.     *cc | *++ | gcc* | *-gcc*)
  473.       mode=link
  474.       for arg
  475.       do
  476.     case "$arg" in
  477.     -c)
  478.        mode=compile
  479.        break
  480.        ;;
  481.     esac
  482.       done
  483.       ;;
  484.     *db | *dbx | *strace | *truss)
  485.       mode=execute
  486.       ;;
  487.     *install*|cp|mv)
  488.       mode=install
  489.       ;;
  490.     *rm)
  491.       mode=uninstall
  492.       ;;
  493.     *)
  494.       # If we have no mode, but dlfiles were specified, then do execute mode.
  495.       test -n "$execute_dlfiles" && mode=execute
  496.  
  497.       # Just use the default operation mode.
  498.       if test -z "$mode"; then
  499.     if test -n "$nonopt"; then
  500.       $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
  501.     else
  502.       $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
  503.     fi
  504.       fi
  505.       ;;
  506.     esac
  507.   fi
  508.  
  509.   # Only execute mode is allowed to have -dlopen flags.
  510.   if test -n "$execute_dlfiles" && test "$mode" != execute; then
  511.     $echo "$modename: unrecognized option \`-dlopen'" 1>&2
  512.     $echo "$help" 1>&2
  513.     exit 1
  514.   fi
  515.  
  516.   # Change the help message to a mode-specific one.
  517.   generic_help="$help"
  518.   help="Try \`$modename --help --mode=$mode' for more information."
  519.  
  520.   # These modes are in order of execution frequency so that they run quickly.
  521.   case "$mode" in
  522.   # libtool compile mode
  523.   compile)
  524.     modename="$modename: compile"
  525.     # Get the compilation command and the source file.
  526.     base_compile=
  527.     lastarg=
  528.     srcfile="$nonopt"
  529.     suppress_output=
  530.  
  531.     user_target=no
  532.     for arg
  533.     do
  534.       # Accept any command-line options.
  535.       case "$arg" in
  536.       -o)
  537.     if test "$user_target" != "no"; then
  538.       $echo "$modename: you cannot specify \`-o' more than once" 1>&2
  539.       exit 1
  540.     fi
  541.     user_target=next
  542.     ;;
  543.  
  544.       -static)
  545.     build_old_libs=yes
  546.     continue
  547.     ;;
  548.       esac
  549.  
  550.       case "$user_target" in
  551.       next)
  552.     # The next one is the -o target name
  553.     user_target=yes
  554.     continue
  555.     ;;
  556.       yes)
  557.     # We got the output file
  558.     user_target=set
  559.     libobj="$arg"
  560.     continue
  561.     ;;
  562.       esac
  563.  
  564.       # Accept the current argument as the source file.
  565.       lastarg="$srcfile"
  566.       srcfile="$arg"
  567.  
  568.       # Aesthetically quote the previous argument.
  569.  
  570.       # Backslashify any backslashes, double quotes, and dollar signs.
  571.       # These are the only characters that are still specially
  572.       # interpreted inside of double-quoted scrings.
  573.       lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
  574.  
  575.       # Double-quote args containing other shell metacharacters.
  576.       # Many Bourne shells cannot handle close brackets correctly in scan
  577.       # sets, so we specify it separately.
  578.       case "$lastarg" in
  579.       *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \    ]*|*]*)
  580.     lastarg="\"$lastarg\""
  581.     ;;
  582.       esac
  583.  
  584.       # Add the previous argument to base_compile.
  585.       if test -z "$base_compile"; then
  586.     base_compile="$lastarg"
  587.       else
  588.     base_compile="$base_compile $lastarg"
  589.       fi
  590.     done
  591.  
  592.     case "$user_target" in
  593.     set)
  594.       ;;
  595.     no)
  596.       # Get the name of the library object.
  597.       libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
  598.       ;;
  599.     *)
  600.       $echo "$modename: you must specify a target with \`-o'" 1>&2
  601.       exit 1
  602.       ;;
  603.     esac
  604.  
  605.     # Recognize several different file suffixes.
  606.     # If the user specifies -o file.o, it is replaced with file.lo
  607.     xform='[cCFSfmso]'
  608.     case "$libobj" in
  609.     *.ada) xform=ada ;;
  610.     *.adb) xform=adb ;;
  611.     *.ads) xform=ads ;;
  612.     *.asm) xform=asm ;;
  613.     *.c++) xform=c++ ;;
  614.     *.cc) xform=cc ;;
  615.     *.cpp) xform=cpp ;;
  616.     *.cxx) xform=cxx ;;
  617.     *.f90) xform=f90 ;;
  618.     *.for) xform=for ;;
  619.     esac
  620.  
  621.     libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
  622.  
  623.     case "$libobj" in
  624.     *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
  625.     *)
  626.       $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
  627.       exit 1
  628.       ;;
  629.     esac
  630.  
  631.     if test -z "$base_compile"; then
  632.       $echo "$modename: you must specify a compilation command" 1>&2
  633.       $echo "$help" 1>&2
  634.       exit 1
  635.     fi
  636.  
  637.     # Delete any leftover library objects.
  638.     if test "$build_old_libs" = yes; then
  639.       removelist="$obj $libobj"
  640.     else
  641.       removelist="$libobj"
  642.     fi
  643.  
  644.     $run $rm $removelist
  645.     trap "$run $rm $removelist; exit 1" 1 2 15
  646.  
  647.     # Calculate the filename of the output object if compiler does
  648.     # not support -o with -c
  649.     if test "$compiler_c_o" = no; then
  650.       output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\..*$%%'`.${objext}
  651.       lockfile="$output_obj.lock"
  652.       removelist="$removelist $output_obj $lockfile"
  653.       trap "$run $rm $removelist; exit 1" 1 2 15
  654.     else
  655.       need_locks=no
  656.       lockfile=
  657.     fi
  658.  
  659.     # Lock this critical section if it is needed
  660.     # We use this script file to make the link, it avoids creating a new file
  661.     if test "$need_locks" = yes; then
  662.       until ln "$0" "$lockfile" 2>/dev/null; do
  663.     $show "Waiting for $lockfile to be removed"
  664.     sleep 2
  665.       done
  666.     elif test "$need_locks" = warn; then
  667.       if test -f "$lockfile"; then
  668.     echo "\
  669. *** ERROR, $lockfile exists and contains:
  670. `cat $lockfile 2>/dev/null`
  671.  
  672. This indicates that another process is trying to use the same
  673. temporary object file, and libtool could not work around it because
  674. your compiler does not support \`-c' and \`-o' together.  If you
  675. repeat this compilation, it may succeed, by chance, but you had better
  676. avoid parallel builds (make -j) in this platform, or get a better
  677. compiler."
  678.  
  679.     $run $rm $removelist
  680.     exit 1
  681.       fi
  682.       echo $srcfile > "$lockfile"
  683.     fi
  684.  
  685.     if test -n "$fix_srcfile_path"; then
  686.       eval srcfile=\"$fix_srcfile_path\"
  687.     fi
  688.  
  689.     # Only build a PIC object if we are building libtool libraries.
  690.     if test "$build_libtool_libs" = yes; then
  691.       # Without this assignment, base_compile gets emptied.
  692.       fbsd_hideous_sh_bug=$base_compile
  693.  
  694.       # All platforms use -DPIC, to notify preprocessed assembler code.
  695.       command="$base_compile $pic_flag -DPIC $srcfile"
  696.       if test "$build_old_libs" = yes; then
  697.     lo_libobj="$libobj"
  698.     dir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'`
  699.     if test "X$dir" = "X$libobj"; then
  700.       dir="$objdir"
  701.     else
  702.       dir="$dir/$objdir"
  703.     fi
  704.     libobj="$dir/"`$echo "X$libobj" | $Xsed -e 's%^.*/%%'`
  705.  
  706.     if test -d "$dir"; then
  707.       $show "$rm $libobj"
  708.       $run $rm $libobj
  709.     else
  710.       $show "$mkdir $dir"
  711.       $run $mkdir $dir
  712.       status=$?
  713.       if test $status -ne 0 && test ! -d $dir; then
  714.         exit $status
  715.       fi
  716.     fi
  717.       fi
  718.       if test "$compiler_o_lo" = yes; then
  719.     output_obj="$libobj"
  720.     command="$command -o $output_obj"
  721.       elif test "$compiler_c_o" = yes; then
  722.     output_obj="$obj"
  723.     command="$command -o $output_obj"
  724.       fi
  725.  
  726.       $run $rm "$output_obj"
  727.       $show "$command"
  728.       if $run eval "$command"; then :
  729.       else
  730.     test -n "$output_obj" && $run $rm $removelist
  731.     exit 1
  732.       fi
  733.  
  734.       if test "$need_locks" = warn &&
  735.      test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then
  736.     echo "\
  737. *** ERROR, $lockfile contains:
  738. `cat $lockfile 2>/dev/null`
  739.  
  740. but it should contain:
  741. $srcfile
  742.  
  743. This indicates that another process is trying to use the same
  744. temporary object file, and libtool could not work around it because
  745. your compiler does not support \`-c' and \`-o' together.  If you
  746. repeat this compilation, it may succeed, by chance, but you had better
  747. avoid parallel builds (make -j) in this platform, or get a better
  748. compiler."
  749.  
  750.     $run $rm $removelist
  751.     exit 1
  752.       fi
  753.  
  754.       # Just move the object if needed, then go on to compile the next one
  755.       if test x"$output_obj" != x"$libobj"; then
  756.     $show "$mv $output_obj $libobj"
  757.     if $run $mv $output_obj $libobj; then :
  758.     else
  759.       error=$?
  760.       $run $rm $removelist
  761.       exit $error
  762.     fi
  763.       fi
  764.  
  765.       # If we have no pic_flag, then copy the object into place and finish.
  766.       if test -z "$pic_flag" && test "$build_old_libs" = yes; then
  767.     # Rename the .lo from within objdir to obj
  768.     if test -f $obj; then
  769.       $show $rm $obj
  770.       $run $rm $obj
  771.     fi
  772.  
  773.     $show "$mv $libobj $obj"
  774.     if $run $mv $libobj $obj; then :
  775.     else
  776.       error=$?
  777.       $run $rm $removelist
  778.       exit $error
  779.     fi
  780.  
  781.     # Now arrange that obj and lo_libobj become the same file
  782.     $show "$LN_S $obj $lo_libobj"
  783.     if $run $LN_S $obj $lo_libobj; then
  784.       exit 0
  785.     else
  786.       error=$?
  787.       $run $rm $removelist
  788.       exit $error
  789.     fi
  790.       fi
  791.  
  792.       # Allow error messages only from the first compilation.
  793.       suppress_output=' >/dev/null 2>&1'
  794.     fi
  795.  
  796.     # Only build a position-dependent object if we build old libraries.
  797.     if test "$build_old_libs" = yes; then
  798.       command="$base_compile $srcfile"
  799.       if test "$compiler_c_o" = yes; then
  800.     command="$command -o $obj"
  801.     output_obj="$obj"
  802.       fi
  803.  
  804.       # Suppress compiler output if we already did a PIC compilation.
  805.       command="$command$suppress_output"
  806.       $run $rm "$output_obj"
  807.       $show "$command"
  808.       if $run eval "$command"; then :
  809.       else
  810.     $run $rm $removelist
  811.     exit 1
  812.       fi
  813.  
  814.       if test "$need_locks" = warn &&
  815.      test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then
  816.     echo "\
  817. *** ERROR, $lockfile contains:
  818. `cat $lockfile 2>/dev/null`
  819.  
  820. but it should contain:
  821. $srcfile
  822.  
  823. This indicates that another process is trying to use the same
  824. temporary object file, and libtool could not work around it because
  825. your compiler does not support \`-c' and \`-o' together.  If you
  826. repeat this compilation, it may succeed, by chance, but you had better
  827. avoid parallel builds (make -j) in this platform, or get a better
  828. compiler."
  829.  
  830.     $run $rm $removelist
  831.     exit 1
  832.       fi
  833.  
  834.       # Just move the object if needed
  835.       if test x"$output_obj" != x"$obj"; then
  836.     $show "$mv $output_obj $obj"
  837.     if $run $mv $output_obj $obj; then :
  838.     else
  839.       error=$?
  840.       $run $rm $removelist
  841.       exit $error
  842.     fi
  843.       fi
  844.  
  845.       # Create an invalid libtool object if no PIC, so that we do not
  846.       # accidentally link it into a program.
  847.       if test "$build_libtool_libs" != yes; then
  848.     $show "echo timestamp > $libobj"
  849.     $run eval "echo timestamp > \$libobj" || exit $?
  850.       else
  851.     # Move the .lo from within objdir
  852.     $show "$mv $libobj $lo_libobj"
  853.     if $run $mv $libobj $lo_libobj; then :
  854.     else
  855.       error=$?
  856.       $run $rm $removelist
  857.       exit $error
  858.     fi
  859.       fi
  860.     fi
  861.  
  862.     # Unlock the critical section if it was locked
  863.     if test "$need_locks" != no; then
  864.       $rm "$lockfile"
  865.     fi
  866.  
  867.     exit 0
  868.     ;;
  869.  
  870.   # libtool link mode
  871.   link)
  872.     modename="$modename: link"
  873.     C_compiler="$CC" # save it, to compile generated C sources
  874.     CC="$nonopt"
  875.     case "$host" in
  876.     *-*-cygwin* | *-*-mingw* | *-*-os2*)
  877.       # It is impossible to link a dll without this setting, and
  878.       # we shouldn't force the makefile maintainer to figure out
  879.       # which system we are compiling for in order to pass an extra
  880.       # flag for every libtool invokation.
  881.       # allow_undefined=no
  882.  
  883.       # FIXME: Unfortunately, there are problems with the above when trying
  884.       # to make a dll which has undefined symbols, in which case not
  885.       # even a static library is built.  For now, we need to specify
  886.       # -no-undefined on the libtool link line when we can be certain
  887.       # that all symbols are satisfied, otherwise we get a static library.
  888.       allow_undefined=yes
  889.  
  890.       # This is a source program that is used to create dlls on Windows
  891.       # Don't remove nor modify the starting and closing comments
  892. # /* ltdll.c starts here */
  893. # #define WIN32_LEAN_AND_MEAN
  894. # #include <windows.h>
  895. # #undef WIN32_LEAN_AND_MEAN
  896. # #include <stdio.h>
  897. #
  898. # #ifdef __cplusplus
  899. # extern "C" {
  900. # #endif
  901. # BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved);
  902. # #ifdef __cplusplus
  903. # }
  904. # #endif
  905. #
  906. # #include <cygwin/cygwin_dll.h>
  907. # DECLARE_CYGWIN_DLL( DllMain );
  908. # HINSTANCE __hDllInstance_base;
  909. #
  910. # BOOL APIENTRY
  911. # DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved)
  912. # {
  913. #   __hDllInstance_base = hInst;
  914. #   return TRUE;
  915. # }
  916. # /* ltdll.c ends here */
  917.       # This is a source program that is used to create import libraries
  918.       # on Windows for dlls which lack them. Don't remove nor modify the
  919.       # starting and closing comments
  920. # /* impgen.c starts here */
  921. # /*   Copyright (C) 1999 Free Software Foundation, Inc.
  922. #  This file is part of GNU libtool.
  923. #  This program is free software; you can redistribute it and/or modify
  924. #  it under the terms of the GNU General Public License as published by
  925. #  the Free Software Foundation; either version 2 of the License, or
  926. #  (at your option) any later version.
  927. #  This program is distributed in the hope that it will be useful,
  928. #  but WITHOUT ANY WARRANTY; without even the implied warranty of
  929. #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  930. #  GNU General Public License for more details.
  931. #  You should have received a copy of the GNU General Public License
  932. #  along with this program; if not, write to the Free Software
  933. #  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  934. #  */
  935. #  #include <stdio.h>        /* for printf() */
  936. #  #include <unistd.h>        /* for open(), lseek(), read() */
  937. #  #include <fcntl.h>        /* for O_RDONLY, O_BINARY */
  938. #  #include <string.h>        /* for strdup() */
  939. #  static unsigned int
  940. #  pe_get16 (fd, offset)
  941. #       int fd;
  942. #       int offset;
  943. #  {
  944. #    unsigned char b[2];
  945. #    lseek (fd, offset, SEEK_SET);
  946. #    read (fd, b, 2);
  947. #    return b[0] + (b[1]<<8);
  948. #  }
  949. #  static unsigned int
  950. #  pe_get32 (fd, offset)
  951. #      int fd;
  952. #      int offset;
  953. #  {
  954. #    unsigned char b[4];
  955. #    lseek (fd, offset, SEEK_SET);
  956. #    read (fd, b, 4);
  957. #    return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24);
  958. #  }
  959. #  static unsigned int
  960. #  pe_as32 (ptr)
  961. #       void *ptr;
  962. #  {
  963. #    unsigned char *b = ptr;
  964. #    return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24);
  965. #  }
  966. #  int
  967. #  main (argc, argv)
  968. #      int argc;
  969. #      char *argv[];
  970. #  {
  971. #      int dll;
  972. #      unsigned long pe_header_offset, opthdr_ofs, num_entries, i;
  973. #      unsigned long export_rva, export_size, nsections, secptr, expptr;
  974. #      unsigned long name_rvas, nexp;
  975. #      unsigned char *expdata, *erva;
  976. #      char *filename, *dll_name;
  977. #      filename = argv[1];
  978. #      dll = open(filename, O_RDONLY|O_BINARY);
  979. #      if (!dll)
  980. #      return 1;
  981. #      dll_name = filename;
  982. #    
  983. #      for (i=0; filename[i]; i++)
  984. #      if (filename[i] == '/' || filename[i] == '\\'  || filename[i] == ':')
  985. #          dll_name = filename + i +1;
  986. #      pe_header_offset = pe_get32 (dll, 0x3c);
  987. #      opthdr_ofs = pe_header_offset + 4 + 20;
  988. #      num_entries = pe_get32 (dll, opthdr_ofs + 92);
  989. #      if (num_entries < 1) /* no exports */
  990. #      return 1;
  991. #      export_rva = pe_get32 (dll, opthdr_ofs + 96);
  992. #      export_size = pe_get32 (dll, opthdr_ofs + 100);
  993. #      nsections = pe_get16 (dll, pe_header_offset + 4 +2);
  994. #      secptr = (pe_header_offset + 4 + 20 +
  995. #            pe_get16 (dll, pe_header_offset + 4 + 16));
  996. #      expptr = 0;
  997. #      for (i = 0; i < nsections; i++)
  998. #      {
  999. #      char sname[8];
  1000. #      unsigned long secptr1 = secptr + 40 * i;
  1001. #      unsigned long vaddr = pe_get32 (dll, secptr1 + 12);
  1002. #      unsigned long vsize = pe_get32 (dll, secptr1 + 16);
  1003. #      unsigned long fptr = pe_get32 (dll, secptr1 + 20);
  1004. #      lseek(dll, secptr1, SEEK_SET);
  1005. #      read(dll, sname, 8);
  1006. #      if (vaddr <= export_rva && vaddr+vsize > export_rva)
  1007. #      {
  1008. #          expptr = fptr + (export_rva - vaddr);
  1009. #          if (export_rva + export_size > vaddr + vsize)
  1010. #          export_size = vsize - (export_rva - vaddr);
  1011. #          break;
  1012. #      }
  1013. #      }
  1014. #      expdata = (unsigned char*)malloc(export_size);
  1015. #      lseek (dll, expptr, SEEK_SET);
  1016. #      read (dll, expdata, export_size);
  1017. #      erva = expdata - export_rva;
  1018. #      nexp = pe_as32 (expdata+24);
  1019. #      name_rvas = pe_as32 (expdata+32);
  1020. #      printf ("EXPORTS\n");
  1021. #      for (i = 0; i<nexp; i++)
  1022. #      {
  1023. #      unsigned long name_rva = pe_as32 (erva+name_rvas+i*4);
  1024. #      printf ("\t%s @ %ld ;\n", erva+name_rva, 1+ i);
  1025. #      }
  1026. #      return 0;
  1027. #  }
  1028. # /* impgen.c ends here */
  1029.       ;;
  1030.     *)
  1031.       allow_undefined=yes
  1032.       ;;
  1033.     esac
  1034.     compile_command="$CC"
  1035.     finalize_command="$CC"
  1036.  
  1037.     compile_rpath=
  1038.     finalize_rpath=
  1039.     compile_shlibpath=
  1040.     finalize_shlibpath=
  1041.     convenience=
  1042.     old_convenience=
  1043.     deplibs=
  1044.     linkopts=
  1045.  
  1046.     if test -n "$shlibpath_var"; then
  1047.       # get the directories listed in $shlibpath_var
  1048.       eval lib_search_path=\`\$echo \"X \${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
  1049.     else
  1050.       lib_search_path=
  1051.     fi
  1052.     # now prepend the system-specific ones
  1053.     eval lib_search_path=\"$sys_lib_search_path_spec\$lib_search_path\"
  1054.     eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
  1055.     
  1056.     avoid_version=no
  1057.     dlfiles=
  1058.     dlprefiles=
  1059.     dlself=no
  1060.     export_dynamic=no
  1061.     export_symbols=
  1062.     export_symbols_regex=
  1063.     generated=
  1064.     libobjs=
  1065.     link_against_libtool_libs=
  1066.     ltlibs=
  1067.     module=no
  1068.     objs=
  1069.     prefer_static_libs=no
  1070.     preload=no
  1071.     prev=
  1072.     prevarg=
  1073.     release=
  1074.     rpath=
  1075.     xrpath=
  1076.     perm_rpath=
  1077.     temp_rpath=
  1078.     thread_safe=no
  1079.     vinfo=
  1080.  
  1081.     # We need to know -static, to get the right output filenames.
  1082.     for arg
  1083.     do
  1084.       case "$arg" in
  1085.       -all-static | -static)
  1086.     if test "X$arg" = "X-all-static"; then
  1087.       if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
  1088.         $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
  1089.       fi
  1090.       if test -n "$link_static_flag"; then
  1091.         dlopen_self=$dlopen_self_static
  1092.       fi
  1093.     else
  1094.       if test -z "$pic_flag" && test -n "$link_static_flag"; then
  1095.         dlopen_self=$dlopen_self_static
  1096.       fi
  1097.     fi
  1098.     build_libtool_libs=no
  1099.     build_old_libs=yes
  1100.     prefer_static_libs=yes
  1101.     break
  1102.     ;;
  1103.       esac
  1104.     done
  1105.  
  1106.     # See if our shared archives depend on static archives.
  1107.     test -n "$old_archive_from_new_cmds" && build_old_libs=yes
  1108.  
  1109.     # Go through the arguments, transforming them on the way.
  1110.     while test $# -gt 0; do
  1111.       arg="$1"
  1112.       shift
  1113.  
  1114.       # If the previous option needs an argument, assign it.
  1115.       if test -n "$prev"; then
  1116.     case "$prev" in
  1117.     output)
  1118.       compile_command="$compile_command @OUTPUT@"
  1119.       finalize_command="$finalize_command @OUTPUT@"
  1120.       ;;
  1121.     esac
  1122.  
  1123.     case "$prev" in
  1124.     dlfiles|dlprefiles)
  1125.       if test "$preload" = no; then
  1126.         # Add the symbol object into the linking commands.
  1127.         compile_command="$compile_command @SYMFILE@"
  1128.         finalize_command="$finalize_command @SYMFILE@"
  1129.         preload=yes
  1130.       fi
  1131.       case "$arg" in
  1132.       *.la | *.lo) ;;  # We handle these cases below.
  1133.       self)
  1134.         if test "$prev" = dlprefiles; then
  1135.           dlself=yes
  1136.         elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
  1137.           dlself=yes
  1138.         else
  1139.           dlself=needless
  1140.           export_dynamic=yes
  1141.         fi
  1142.         prev=
  1143.         continue
  1144.         ;;
  1145.       *)
  1146.         if test "$prev" = dlfiles; then
  1147.           dlfiles="$dlfiles $arg"
  1148.         else
  1149.           dlprefiles="$dlprefiles $arg"
  1150.         fi
  1151.         prev=
  1152.         ;;
  1153.       esac
  1154.       ;;
  1155.     expsyms)
  1156.       export_symbols="$arg"
  1157.       if test ! -f "$arg"; then
  1158.         $echo "$modename: symbol file \`$arg' does not exist"
  1159.         exit 1
  1160.       fi
  1161.       prev=
  1162.       continue
  1163.       ;;
  1164.     expsyms_regex)
  1165.       export_symbols_regex="$arg"
  1166.       prev=
  1167.       continue
  1168.       ;;
  1169.     release)
  1170.       release="-$arg"
  1171.       prev=
  1172.       continue
  1173.       ;;
  1174.     rpath | xrpath)
  1175.       # We need an absolute path.
  1176.       case "$arg" in
  1177.       [\\/]* | [A-Za-z]:[\\/]*) ;;
  1178.       *)
  1179.         $echo "$modename: only absolute run-paths are allowed" 1>&2
  1180.         exit 1
  1181.         ;;
  1182.       esac
  1183.       if test "$prev" = rpath; then
  1184.         case "$rpath " in
  1185.         *" $arg "*) ;;
  1186.         *) rpath="$rpath $arg" ;;
  1187.         esac
  1188.       else
  1189.         case "$xrpath " in
  1190.         *" $arg "*) ;;
  1191.         *) xrpath="$xrpath $arg" ;;
  1192.         esac
  1193.       fi
  1194.       prev=
  1195.       continue
  1196.       ;;
  1197.     *)
  1198.       eval "$prev=\"\$arg\""
  1199.       prev=
  1200.       continue
  1201.       ;;
  1202.     esac
  1203.       fi
  1204.  
  1205.       prevarg="$arg"
  1206.  
  1207.       case "$arg" in
  1208.       -all-static)
  1209.     if test -n "$link_static_flag"; then
  1210.       compile_command="$compile_command $link_static_flag"
  1211.       finalize_command="$finalize_command $link_static_flag"
  1212.     fi
  1213.     continue
  1214.     ;;
  1215.  
  1216.       -allow-undefined)
  1217.     # FIXME: remove this flag sometime in the future.
  1218.     $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
  1219.     continue
  1220.     ;;
  1221.  
  1222.       -avoid-version)
  1223.     avoid_version=yes
  1224.     continue
  1225.     ;;
  1226.  
  1227.       -dlopen)
  1228.     prev=dlfiles
  1229.     continue
  1230.     ;;
  1231.  
  1232.       -dlpreopen)
  1233.     prev=dlprefiles
  1234.     continue
  1235.     ;;
  1236.  
  1237.       -export-dynamic)
  1238.     export_dynamic=yes
  1239.     continue
  1240.     ;;
  1241.  
  1242.       -export-symbols | -export-symbols-regex)
  1243.     if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
  1244.       $echo "$modename: not more than one -exported-symbols argument allowed"
  1245.       exit 1
  1246.     fi
  1247.     if test "X$arg" = "X-export-symbols"; then
  1248.       prev=expsyms
  1249.     else
  1250.       prev=expsyms_regex
  1251.     fi
  1252.     continue
  1253.     ;;
  1254.  
  1255.       -L*)
  1256.     dir=`$echo "X$arg" | $Xsed -e 's/^-L//'`
  1257.     # We need an absolute path.
  1258.     case "$dir" in
  1259.     [\\/]* | [A-Za-z]:[\\/]*) ;;
  1260.     *)
  1261.       absdir=`cd "$dir" && pwd`
  1262.       if test -z "$absdir"; then
  1263.         $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
  1264.         $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
  1265.         absdir="$dir"
  1266.       fi
  1267.       dir="$absdir"
  1268.       ;;
  1269.     esac
  1270.     case " $deplibs " in
  1271.     *" $arg "*) ;;
  1272.     *) deplibs="$deplibs $arg";;
  1273.     esac
  1274.     case " $lib_search_path " in
  1275.     *" $dir "*) ;;
  1276.     *) lib_search_path="$lib_search_path $dir";;
  1277.     esac
  1278.     case "$host" in
  1279.     *-*-cygwin* | *-*-mingw* | *-*-os2*)
  1280.       dllsearchdir=`cd "$dir" && pwd || echo "$dir"`
  1281.       case ":$dllsearchpath:" in
  1282.       ::) dllsearchpath="$dllsearchdir";;
  1283.       *":$dllsearchdir:"*) ;;
  1284.       *) dllsearchpath="$dllsearchpath:$dllsearchdir";;
  1285.       esac
  1286.       ;;
  1287.     esac
  1288.     ;;
  1289.  
  1290.       -l*)
  1291.     if test "$arg" = "-lc"; then
  1292.       case "$host" in
  1293.       *-*-cygwin* | *-*-mingw* | *-*-os2* | *-*-beos*)
  1294.         # These systems don't actually have c library (as such)
  1295.         continue
  1296.         ;;
  1297.       esac
  1298.     elif test "$arg" = "-lm"; then
  1299.       case "$host" in
  1300.       *-*-cygwin* | *-*-beos*)
  1301.         # These systems don't actually have math library (as such)
  1302.         continue
  1303.         ;;
  1304.       esac
  1305.     fi
  1306.     deplibs="$deplibs $arg"
  1307.     ;;
  1308.  
  1309.       -module)
  1310.     module=yes
  1311.     continue
  1312.     ;;
  1313.  
  1314.       -no-undefined)
  1315.     allow_undefined=no
  1316.     continue
  1317.     ;;
  1318.  
  1319.       -o) prev=output ;;
  1320.  
  1321.       -release)
  1322.     prev=release
  1323.     continue
  1324.     ;;
  1325.  
  1326.       -rpath)
  1327.     prev=rpath
  1328.     continue
  1329.     ;;
  1330.  
  1331.       -R)
  1332.     prev=xrpath
  1333.     continue
  1334.     ;;
  1335.  
  1336.       -R*)
  1337.     dir=`$echo "X$arg" | $Xsed -e 's/^-R//'`
  1338.     # We need an absolute path.
  1339.     case "$dir" in
  1340.     [\\/]* | [A-Za-z]:[\\/]*) ;;
  1341.     *)
  1342.       $echo "$modename: only absolute run-paths are allowed" 1>&2
  1343.       exit 1
  1344.       ;;
  1345.     esac
  1346.     case "$xrpath " in
  1347.     *" $dir "*) ;;
  1348.     *) xrpath="$xrpath $dir" ;;
  1349.     esac
  1350.     continue
  1351.     ;;
  1352.  
  1353.       -static)
  1354.     # If we have no pic_flag, then this is the same as -all-static.
  1355.     if test -z "$pic_flag" && test -n "$link_static_flag"; then
  1356.       compile_command="$compile_command $link_static_flag"
  1357.       finalize_command="$finalize_command $link_static_flag"
  1358.     fi
  1359.     continue
  1360.     ;;
  1361.  
  1362.       -thread-safe)
  1363.     thread_safe=yes
  1364.     continue
  1365.     ;;
  1366.  
  1367.       -version-info)
  1368.     prev=vinfo
  1369.     continue
  1370.     ;;
  1371.  
  1372.       # Some other compiler flag.
  1373.       -* | +*)
  1374.     # Unknown arguments in both finalize_command and compile_command need
  1375.     # to be aesthetically quoted because they are evaled later.
  1376.     arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
  1377.     case "$arg" in
  1378.     *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \    ]*|*]*)
  1379.       arg="\"$arg\""
  1380.       ;;
  1381.     esac
  1382.     ;;
  1383.  
  1384.       *.o | *.obj | *.a | *.lib)
  1385.     # A standard object.
  1386.     objs="$objs $arg"
  1387.     ;;
  1388.  
  1389.       *.lo)
  1390.     # A library object.
  1391.     if test "$prev" = dlfiles; then
  1392.       dlfiles="$dlfiles $arg"
  1393.       if test "$build_libtool_libs" = yes && test "$dlopen" = yes; then
  1394.         prev=
  1395.         continue
  1396.       else
  1397.         # If libtool objects are unsupported, then we need to preload.
  1398.         prev=dlprefiles
  1399.       fi
  1400.     fi
  1401.  
  1402.     if test "$prev" = dlprefiles; then
  1403.       # Preload the old-style object.
  1404.       dlprefiles="$dlprefiles "`$echo "X$arg" | $Xsed -e "$lo2o"`
  1405.       prev=
  1406.     fi
  1407.     libobjs="$libobjs $arg"
  1408.     ;;
  1409.  
  1410.       *.la)
  1411.     # A libtool-controlled library.
  1412.  
  1413.     dlname=
  1414.     libdir=
  1415.     library_names=
  1416.     old_library=
  1417.  
  1418.     # Check to see that this really is a libtool archive.
  1419.     if (sed -e '2q' $arg | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
  1420.     else
  1421.       $echo "$modename: \`$arg' is not a valid libtool archive" 1>&2
  1422.       exit 1
  1423.     fi
  1424.  
  1425.     # If the library was installed with an old release of libtool,
  1426.     # it will not redefine variable installed.
  1427.     installed=yes
  1428.  
  1429.     # Read the .la file
  1430.     # If there is no directory component, then add one.
  1431.     case "$arg" in
  1432.     */* | *\\*) . $arg ;;
  1433.     *) . ./$arg ;;
  1434.     esac
  1435.  
  1436.     # Get the name of the library we link against.
  1437.     linklib=
  1438.     for l in $old_library $library_names; do
  1439.       linklib="$l"
  1440.     done
  1441.  
  1442.     if test -z "$linklib"; then
  1443.       $echo "$modename: cannot find name of link library for \`$arg'" 1>&2
  1444.       exit 1
  1445.     fi
  1446.  
  1447.     # Find the relevant object directory and library name.
  1448.     name=`$echo "X$arg" | $Xsed -e 's%^.*/%%' -e 's/\.la$//' -e 's/^lib//'`
  1449.  
  1450.     if test "X$installed" = Xyes; then
  1451.       dir="$libdir"
  1452.     else
  1453.       dir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
  1454.       if test "X$dir" = "X$arg"; then
  1455.         dir="$objdir"
  1456.       else
  1457.         dir="$dir/$objdir"
  1458.       fi
  1459.     fi
  1460.  
  1461.     if test -n "$dependency_libs"; then
  1462.       # Extract -R from dependency_libs
  1463.       temp_deplibs=
  1464.       for deplib in $dependency_libs; do
  1465.         case "$deplib" in
  1466.         -R*) temp_xrpath=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
  1467.          case " $rpath $xrpath " in
  1468.          *" $temp_xrpath "*) ;;
  1469.          *) xrpath="$xrpath $temp_xrpath";;
  1470.          esac;;
  1471.         -L*) case "$compile_command $temp_deplibs " in
  1472.          *" $deplib "*) ;;
  1473.          *) temp_deplibs="$temp_deplibs $deplib";;
  1474.          esac;;
  1475.         *) temp_deplibs="$temp_deplibs $deplib";;
  1476.         esac
  1477.       done
  1478.       dependency_libs="$temp_deplibs"
  1479.     fi
  1480.  
  1481.     if test -z "$libdir"; then
  1482.       # It is a libtool convenience library, so add in its objects.
  1483.       convenience="$convenience $dir/$old_library"
  1484.       old_convenience="$old_convenience $dir/$old_library"
  1485.       deplibs="$deplibs$dependency_libs"
  1486.       compile_command="$compile_command $dir/$old_library$dependency_libs"
  1487.       finalize_command="$finalize_command $dir/$old_library$dependency_libs"
  1488.       continue
  1489.     fi
  1490.  
  1491.     # This library was specified with -dlopen.
  1492.     if test "$prev" = dlfiles; then
  1493.       dlfiles="$dlfiles $arg"
  1494.       if test -z "$dlname" || test "$dlopen" != yes || test "$build_libtool_libs" = no; then
  1495.         # If there is no dlname, no dlopen support or we're linking statically,
  1496.         # we need to preload.
  1497.         prev=dlprefiles
  1498.       else
  1499.         # We should not create a dependency on this library, but we
  1500.         # may need any libraries it requires.
  1501.         compile_command="$compile_command$dependency_libs"
  1502.         finalize_command="$finalize_command$dependency_libs"
  1503.         prev=
  1504.         continue
  1505.       fi
  1506.     fi
  1507.  
  1508.     # The library was specified with -dlpreopen.
  1509.     if test "$prev" = dlprefiles; then
  1510.       # Prefer using a static library (so that no silly _DYNAMIC symbols
  1511.       # are required to link).
  1512.       if test -n "$old_library"; then
  1513.         dlprefiles="$dlprefiles $dir/$old_library"
  1514.       else
  1515.         dlprefiles="$dlprefiles $dir/$linklib"
  1516.       fi
  1517.       prev=
  1518.     fi
  1519.  
  1520.     if test -n "$library_names" &&
  1521.        { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
  1522.       link_against_libtool_libs="$link_against_libtool_libs $arg"
  1523.       if test -n "$shlibpath_var"; then
  1524.         # Make sure the rpath contains only unique directories.
  1525.         case "$temp_rpath " in
  1526.         *" $dir "*) ;;
  1527.         *) temp_rpath="$temp_rpath $dir" ;;
  1528.         esac
  1529.       fi
  1530.  
  1531.       # We need an absolute path.
  1532.       case "$dir" in
  1533.       [\\/] | [A-Za-z]:[\\/]*) absdir="$dir" ;;
  1534.       *)
  1535.         absdir=`cd "$dir" && pwd`
  1536.         if test -z "$absdir"; then
  1537.           $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
  1538.           $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
  1539.           absdir="$dir"
  1540.         fi
  1541.         ;;
  1542.       esac
  1543.       
  1544.       # This is the magic to use -rpath.
  1545.       # Skip directories that are in the system default run-time
  1546.       # search path, unless they have been requested with -R.
  1547.       case " $sys_lib_dlsearch_path " in
  1548.       *" $absdir "*) ;;
  1549.       *)
  1550.         case "$compile_rpath " in
  1551.         *" $absdir "*) ;;
  1552.         *) compile_rpath="$compile_rpath $absdir" 
  1553.         esac
  1554.         ;;
  1555.       esac
  1556.  
  1557.       case " $sys_lib_dlsearch_path " in
  1558.       *" $libdir "*) ;;
  1559.       *)
  1560.         case "$finalize_rpath " in
  1561.         *" $libdir "*) ;;
  1562.         *) finalize_rpath="$finalize_rpath $libdir"
  1563.         esac
  1564.         ;;
  1565.       esac
  1566.  
  1567.       lib_linked=yes
  1568.       case "$hardcode_action" in
  1569.       immediate | unsupported)
  1570.         if test "$hardcode_direct" = no; then
  1571.           compile_command="$compile_command $dir/$linklib"
  1572.           deplibs="$deplibs $dir/$linklib"
  1573.           case "$host" in
  1574.           *-*-cygwin* | *-*-mingw* | *-*-os2*)
  1575.         dllsearchdir=`cd "$dir" && pwd || echo "$dir"`
  1576.         if test -n "$dllsearchpath"; then
  1577.           dllsearchpath="$dllsearchpath:$dllsearchdir"
  1578.         else
  1579.           dllsearchpath="$dllsearchdir"
  1580.         fi
  1581.         ;;
  1582.           esac
  1583.         elif test "$hardcode_minus_L" = no; then
  1584.           case "$host" in
  1585.           *-*-sunos*)
  1586.         compile_shlibpath="$compile_shlibpath$dir:"
  1587.         ;;
  1588.           esac
  1589.           case "$compile_command " in
  1590.           *" -L$dir "*) ;;
  1591.           *) compile_command="$compile_command -L$dir";;
  1592.           esac
  1593.           compile_command="$compile_command -l$name"
  1594.           deplibs="$deplibs -L$dir -l$name"
  1595.         elif test "$hardcode_shlibpath_var" = no; then
  1596.           case ":$compile_shlibpath:" in
  1597.           *":$dir:"*) ;;
  1598.           *) compile_shlibpath="$compile_shlibpath$dir:";;
  1599.           esac
  1600.           compile_command="$compile_command -l$name"
  1601.           deplibs="$deplibs -l$name"
  1602.         else
  1603.           lib_linked=no
  1604.         fi
  1605.         ;;
  1606.  
  1607.       relink)
  1608.         if test "$hardcode_direct" = yes; then
  1609.           compile_command="$compile_command $absdir/$linklib"
  1610.           deplibs="$deplibs $absdir/$linklib"
  1611.         elif test "$hardcode_minus_L" = yes; then
  1612.           case "$compile_command " in
  1613.           *" -L$absdir "*) ;;
  1614.           *) compile_command="$compile_command -L$absdir";;
  1615.           esac
  1616.           compile_command="$compile_command -l$name"
  1617.           deplibs="$deplibs -L$absdir -l$name"
  1618.         elif test "$hardcode_shlibpath_var" = yes; then
  1619.           case ":$compile_shlibpath:" in
  1620.           *":$absdir:"*) ;;
  1621.           *) compile_shlibpath="$compile_shlibpath$absdir:";;
  1622.           esac
  1623.           compile_command="$compile_command -l$name"
  1624.           deplibs="$deplibs -l$name"
  1625.         else
  1626.           lib_linked=no
  1627.         fi
  1628.         ;;
  1629.  
  1630.       *)
  1631.         lib_linked=no
  1632.         ;;
  1633.       esac
  1634.  
  1635.       if test "$lib_linked" != yes; then
  1636.         $echo "$modename: configuration error: unsupported hardcode properties"
  1637.         exit 1
  1638.       fi
  1639.  
  1640.       # Finalize command for both is simple: just hardcode it.
  1641.       if test "$hardcode_direct" = yes; then
  1642.         finalize_command="$finalize_command $libdir/$linklib"
  1643.       elif test "$hardcode_minus_L" = yes; then
  1644.         case "$finalize_command " in
  1645.         *" -L$libdir "*) ;;
  1646.         *) finalize_command="$finalize_command -L$libdir";;
  1647.         esac
  1648.         finalize_command="$finalize_command -l$name"
  1649.       elif test "$hardcode_shlibpath_var" = yes; then
  1650.         case ":$finalize_shlibpath:" in
  1651.         *":$libdir:"*) ;;
  1652.         *) finalize_shlibpath="$finalize_shlibpath$libdir:";;
  1653.         esac
  1654.         finalize_command="$finalize_command -l$name"
  1655.       else
  1656.         # We cannot seem to hardcode it, guess we'll fake it.
  1657.         case "$finalize_command " in
  1658.         *" -L$dir "*) ;;
  1659.         *) finalize_command="$finalize_command -L$libdir";;
  1660.         esac
  1661.         finalize_command="$finalize_command -l$name"
  1662.       fi
  1663.     else
  1664.       # Transform directly to old archives if we don't build new libraries.
  1665.       if test -n "$pic_flag" && test -z "$old_library"; then
  1666.         $echo "$modename: cannot find static library for \`$arg'" 1>&2
  1667.         exit 1
  1668.       fi
  1669.  
  1670.       # Here we assume that one of hardcode_direct or hardcode_minus_L
  1671.       # is not unsupported.  This is valid on all known static and
  1672.       # shared platforms.
  1673.       if test "$hardcode_direct" != unsupported; then
  1674.         test -n "$old_library" && linklib="$old_library"
  1675.         compile_command="$compile_command $dir/$linklib"
  1676.         finalize_command="$finalize_command $dir/$linklib"
  1677.       else
  1678.         case "$compile_command " in
  1679.         *" -L$dir "*) ;;
  1680.         *) compile_command="$compile_command -L$dir";;
  1681.         esac
  1682.         compile_command="$compile_command -l$name"
  1683.         case "$finalize_command " in
  1684.         *" -L$dir "*) ;;
  1685.         *) finalize_command="$finalize_command -L$dir";;
  1686.         esac
  1687.         finalize_command="$finalize_command -l$name"
  1688.       fi
  1689.     fi
  1690.  
  1691.     # Add in any libraries that this one depends upon.
  1692.     compile_command="$compile_command$dependency_libs"
  1693.     finalize_command="$finalize_command$dependency_libs"
  1694.     continue
  1695.     ;;
  1696.  
  1697.       # Some other compiler argument.
  1698.       *)
  1699.     # Unknown arguments in both finalize_command and compile_command need
  1700.     # to be aesthetically quoted because they are evaled later.
  1701.     arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
  1702.     case "$arg" in
  1703.     *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \    ]*|*]*)
  1704.       arg="\"$arg\""
  1705.       ;;
  1706.     esac
  1707.     ;;
  1708.       esac
  1709.  
  1710.       # Now actually substitute the argument into the commands.
  1711.       if test -n "$arg"; then
  1712.     compile_command="$compile_command $arg"
  1713.     finalize_command="$finalize_command $arg"
  1714.       fi
  1715.     done
  1716.  
  1717.     if test -n "$prev"; then
  1718.       $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
  1719.       $echo "$help" 1>&2
  1720.       exit 1
  1721.     fi
  1722.  
  1723.     if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
  1724.       eval arg=\"$export_dynamic_flag_spec\"
  1725.       compile_command="$compile_command $arg"
  1726.       finalize_command="$finalize_command $arg"
  1727.     fi
  1728.  
  1729.     oldlibs=
  1730.     # calculate the name of the file, without its directory
  1731.     outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
  1732.     libobjs_save="$libobjs"
  1733.  
  1734.     case "$output" in
  1735.     "")
  1736.       $echo "$modename: you must specify an output file" 1>&2
  1737.       $echo "$help" 1>&2
  1738.       exit 1
  1739.       ;;
  1740.  
  1741.     *.a | *.lib)
  1742.       if test -n "$link_against_libtool_libs"; then
  1743.     $echo "$modename: error: cannot link libtool libraries into archives" 1>&2
  1744.     exit 1
  1745.       fi
  1746.  
  1747.       if test -n "$deplibs"; then
  1748.     $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2
  1749.       fi
  1750.  
  1751.       if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
  1752.     $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
  1753.       fi
  1754.  
  1755.       if test -n "$rpath"; then
  1756.     $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
  1757.       fi
  1758.  
  1759.       if test -n "$xrpath"; then
  1760.     $echo "$modename: warning: \`-R' is ignored for archives" 1>&2
  1761.       fi
  1762.  
  1763.       if test -n "$vinfo"; then
  1764.     $echo "$modename: warning: \`-version-info' is ignored for archives" 1>&2
  1765.       fi
  1766.  
  1767.       if test -n "$release"; then
  1768.     $echo "$modename: warning: \`-release' is ignored for archives" 1>&2
  1769.       fi
  1770.  
  1771.       if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
  1772.     $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
  1773.       fi
  1774.  
  1775.       # Now set the variables for building old libraries.
  1776.       build_libtool_libs=no
  1777.       oldlibs="$output"
  1778.       ;;
  1779.  
  1780.     *.la)
  1781.       # Make sure we only generate libraries of the form `libNAME.la'.
  1782.       case "$outputname" in
  1783.       lib*)
  1784.     name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
  1785.     eval libname=\"$libname_spec\"
  1786.     ;;
  1787.       *)
  1788.     if test "$module" = no; then
  1789.       $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
  1790.       $echo "$help" 1>&2
  1791.       exit 1
  1792.     fi
  1793.     if test "$need_lib_prefix" != no; then
  1794.       # Add the "lib" prefix for modules if required
  1795.       name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
  1796.       eval libname=\"$libname_spec\"
  1797.     else
  1798.       libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
  1799.     fi
  1800.     ;;
  1801.       esac
  1802.  
  1803.       output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
  1804.       if test "X$output_objdir" = "X$output"; then
  1805.     output_objdir="$objdir"
  1806.       else
  1807.     output_objdir="$output_objdir/$objdir"
  1808.       fi
  1809.  
  1810.       if test -n "$objs"; then
  1811.     $echo "$modename: cannot build libtool library \`$output' from non-libtool objects:$objs" 2>&1
  1812.     exit 1
  1813.       fi
  1814.  
  1815.       # How the heck are we supposed to write a wrapper for a shared library?
  1816.       if test -n "$link_against_libtool_libs"; then
  1817.      $echo "$modename: error: cannot link shared libraries into libtool libraries" 1>&2
  1818.      exit 1
  1819.       fi
  1820.  
  1821.       if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
  1822.     $echo "$modename: warning: \`-dlopen' is ignored for libtool libraries" 1>&2
  1823.       fi
  1824.  
  1825.       set dummy $rpath
  1826.       if test $# -gt 2; then
  1827.     $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
  1828.       fi
  1829.       install_libdir="$2"
  1830.  
  1831.       oldlibs=
  1832.       if test -z "$rpath"; then
  1833.     if test "$build_libtool_libs" = yes; then
  1834.       # Building a libtool convenience library.
  1835.       libext=al
  1836.       oldlibs="$output_objdir/$libname.$libext $oldlibs"
  1837.       build_libtool_libs=convenience
  1838.       build_old_libs=yes
  1839.     fi
  1840.     dependency_libs="$deplibs"
  1841.  
  1842.     if test -n "$vinfo"; then
  1843.       $echo "$modename: warning: \`-version-info' is ignored for convenience libraries" 1>&2
  1844.     fi
  1845.  
  1846.     if test -n "$release"; then
  1847.       $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
  1848.     fi
  1849.       else
  1850.  
  1851.     # Parse the version information argument.
  1852.     IFS="${IFS=     }"; save_ifs="$IFS"; IFS=':'
  1853.     set dummy $vinfo 0 0 0
  1854.     IFS="$save_ifs"
  1855.  
  1856.     if test -n "$8"; then
  1857.       $echo "$modename: too many parameters to \`-version-info'" 1>&2
  1858.       $echo "$help" 1>&2
  1859.       exit 1
  1860.     fi
  1861.  
  1862.     current="$2"
  1863.     revision="$3"
  1864.     age="$4"
  1865.  
  1866.     # Check that each of the things are valid numbers.
  1867.     case "$current" in
  1868.     0 | [1-9] | [1-9][0-9]*) ;;
  1869.     *)
  1870.       $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2
  1871.       $echo "$modename: \`$vinfo' is not valid version information" 1>&2
  1872.       exit 1
  1873.       ;;
  1874.     esac
  1875.  
  1876.     case "$revision" in
  1877.     0 | [1-9] | [1-9][0-9]*) ;;
  1878.     *)
  1879.       $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2
  1880.       $echo "$modename: \`$vinfo' is not valid version information" 1>&2
  1881.       exit 1
  1882.       ;;
  1883.     esac
  1884.  
  1885.     case "$age" in
  1886.     0 | [1-9] | [1-9][0-9]*) ;;
  1887.     *)
  1888.       $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2
  1889.       $echo "$modename: \`$vinfo' is not valid version information" 1>&2
  1890.       exit 1
  1891.       ;;
  1892.     esac
  1893.  
  1894.     if test $age -gt $current; then
  1895.       $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
  1896.       $echo "$modename: \`$vinfo' is not valid version information" 1>&2
  1897.       exit 1
  1898.     fi
  1899.  
  1900.     # Calculate the version variables.
  1901.     major=
  1902.     versuffix=
  1903.     verstring=
  1904.     case "$version_type" in
  1905.     none) ;;
  1906.  
  1907.     irix)
  1908.       major=`expr $current - $age + 1`
  1909.       versuffix="$major.$revision"
  1910.       verstring="sgi$major.$revision"
  1911.  
  1912.       # Add in all the interfaces that we are compatible with.
  1913.       loop=$revision
  1914.       while test $loop != 0; do
  1915.         iface=`expr $revision - $loop`
  1916.         loop=`expr $loop - 1`
  1917.         verstring="sgi$major.$iface:$verstring"
  1918.       done
  1919.       ;;
  1920.  
  1921.     linux)
  1922.       major=.`expr $current - $age`
  1923.       versuffix="$major.$age.$revision"
  1924.       ;;
  1925.  
  1926.     osf)
  1927.       major=`expr $current - $age`
  1928.       versuffix=".$current.$age.$revision"
  1929.       verstring="$current.$age.$revision"
  1930.  
  1931.       # Add in all the interfaces that we are compatible with.
  1932.       loop=$age
  1933.       while test $loop != 0; do
  1934.         iface=`expr $current - $loop`
  1935.         loop=`expr $loop - 1`
  1936.         verstring="$verstring:${iface}.0"
  1937.       done
  1938.  
  1939.       # Make executables depend on our current version.
  1940.       verstring="$verstring:${current}.0"
  1941.       ;;
  1942.  
  1943.     sunos)
  1944.       major=".$current"
  1945.       versuffix=".$current.$revision"
  1946.       ;;
  1947.  
  1948.     freebsd-aout)
  1949.       major=".$current"
  1950.       versuffix=".$current.$revision";
  1951.       ;;
  1952.  
  1953.     freebsd-elf)
  1954.       major=".$current"
  1955.       versuffix=".$current";
  1956.       ;;
  1957.  
  1958.     windows)
  1959.       # Like Linux, but with '-' rather than '.', since we only
  1960.       # want one extension on Windows 95.
  1961.       major=`expr $current - $age`
  1962.       versuffix="-$major-$age-$revision"
  1963.       ;;
  1964.  
  1965.     *)
  1966.       $echo "$modename: unknown library version type \`$version_type'" 1>&2
  1967.       echo "Fatal configuration error.  See the $PACKAGE docs for more information." 1>&2
  1968.       exit 1
  1969.       ;;
  1970.     esac
  1971.  
  1972.     # Clear the version info if we defaulted, and they specified a release.
  1973.     if test -z "$vinfo" && test -n "$release"; then
  1974.       major=
  1975.       verstring="0.0"
  1976.       if test "$need_version" = no; then
  1977.         versuffix=
  1978.       else
  1979.         versuffix=".0.0"
  1980.       fi
  1981.     fi
  1982.  
  1983.     # Remove version info from name if versioning should be avoided
  1984.     if test "$avoid_version" = yes && test "$need_version" = no; then
  1985.       major=
  1986.       versuffix=
  1987.       verstring=""
  1988.     fi
  1989.     
  1990.     # Check to see if the archive will have undefined symbols.
  1991.     if test "$allow_undefined" = yes; then
  1992.       if test "$allow_undefined_flag" = unsupported; then
  1993.         $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
  1994.         build_libtool_libs=no
  1995.         build_old_libs=yes
  1996.       fi
  1997.     else
  1998.       # Don't allow undefined symbols.
  1999.       allow_undefined_flag="$no_undefined_flag"
  2000.     fi
  2001.  
  2002.     dependency_libs="$deplibs"
  2003.     case "$host" in
  2004.     *-*-cygwin* | *-*-mingw* | *-*-os2* | *-*-beos*)
  2005.       # these systems don't actually have a c library (as such)!
  2006.       ;;
  2007.     *)
  2008.       # Add libc to deplibs on all other systems.
  2009.       deplibs="$deplibs -lc"
  2010.       ;;
  2011.     esac
  2012.       fi
  2013.  
  2014.       # Create the output directory, or remove our outputs if we need to.
  2015.       if test -d $output_objdir; then
  2016.     $show "${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*"
  2017.     $run ${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*
  2018.       else
  2019.     $show "$mkdir $output_objdir"
  2020.     $run $mkdir $output_objdir
  2021.     status=$?
  2022.     if test $status -ne 0 && test ! -d $output_objdir; then
  2023.       exit $status
  2024.     fi
  2025.       fi
  2026.  
  2027.       # Now set the variables for building old libraries.
  2028.       if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
  2029.     oldlibs="$oldlibs $output_objdir/$libname.$libext"
  2030.  
  2031.     # Transform .lo files to .o files.
  2032.     oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
  2033.       fi
  2034.  
  2035.       if test "$build_libtool_libs" = yes; then
  2036.     # Transform deplibs into only deplibs that can be linked in shared.
  2037.     name_save=$name
  2038.     libname_save=$libname
  2039.     release_save=$release
  2040.     versuffix_save=$versuffix
  2041.     major_save=$major
  2042.     # I'm not sure if I'm treating the release correctly.  I think
  2043.     # release should show up in the -l (ie -lgmp5) so we don't want to
  2044.     # add it in twice.  Is that correct?
  2045.     release=""
  2046.     versuffix=""
  2047.     major=""
  2048.     newdeplibs=
  2049.     droppeddeps=no
  2050.     case "$deplibs_check_method" in
  2051.     pass_all)
  2052.       # Don't check for shared/static.  Everything works.
  2053.       # This might be a little naive.  We might want to check
  2054.       # whether the library exists or not.  But this is on
  2055.       # osf3 & osf4 and I'm not really sure... Just
  2056.       # implementing what was already the behaviour.
  2057.       newdeplibs=$deplibs
  2058.       ;;
  2059.     test_compile)
  2060.       # This code stresses the "libraries are programs" paradigm to its
  2061.       # limits. Maybe even breaks it.  We compile a program, linking it
  2062.       # against the deplibs as a proxy for the library.  Then we can check
  2063.       # whether they linked in statically or dynamically with ldd.
  2064.       $rm conftest.c
  2065.       cat > conftest.c <<EOF
  2066.       int main() { return 0; }
  2067. EOF
  2068.       $rm conftest
  2069.       $C_compiler -o conftest conftest.c $deplibs
  2070.       if test $? -eq 0 ; then
  2071.         ldd_output=`ldd conftest`
  2072.         for i in $deplibs; do
  2073.           name="`expr $i : '-l\(.*\)'`"
  2074.           # If $name is empty we are operating on a -L argument.
  2075.           if test "$name" != "" ; then
  2076.         libname=`eval \\$echo \"$libname_spec\"`
  2077.         deplib_matches=`eval \\$echo \"$library_names_spec\"`
  2078.         set dummy $deplib_matches
  2079.         deplib_match=$2
  2080.         if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
  2081.           newdeplibs="$newdeplibs $i"
  2082.         else
  2083.           droppeddeps=yes
  2084.           echo
  2085.           echo "*** Warning: This library needs some functionality provided by $i."
  2086.           echo "*** I have the capability to make that library automatically link in when"
  2087.           echo "*** you link to this library.  But I can only do this if you have a"
  2088.           echo "*** shared version of the library, which you do not appear to have."
  2089.         fi
  2090.           else
  2091.         newdeplibs="$newdeplibs $i"
  2092.           fi
  2093.         done
  2094.       else
  2095.         # Error occured in the first compile.  Let's try to salvage the situation:
  2096.         # Compile a seperate program for each library.
  2097.         for i in $deplibs; do
  2098.           name="`expr $i : '-l\(.*\)'`"
  2099.          # If $name is empty we are operating on a -L argument.
  2100.           if test "$name" != "" ; then
  2101.         $rm conftest
  2102.         $C_compiler -o conftest conftest.c $i
  2103.         # Did it work?
  2104.         if test $? -eq 0 ; then
  2105.           ldd_output=`ldd conftest`
  2106.           libname=`eval \\$echo \"$libname_spec\"`
  2107.           deplib_matches=`eval \\$echo \"$library_names_spec\"`
  2108.           set dummy $deplib_matches
  2109.           deplib_match=$2
  2110.           if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
  2111.             newdeplibs="$newdeplibs $i"
  2112.           else
  2113.             droppeddeps=yes
  2114.             echo
  2115.             echo "*** Warning: This library needs some functionality provided by $i."
  2116.             echo "*** I have the capability to make that library automatically link in when"
  2117.             echo "*** you link to this library.  But I can only do this if you have a"
  2118.             echo "*** shared version of the library, which you do not appear to have."
  2119.           fi
  2120.         else
  2121.           droppeddeps=yes
  2122.           echo
  2123.           echo "*** Warning!  Library $i is needed by this library but I was not able to"
  2124.           echo "***  make it link in!  You will probably need to install it or some"
  2125.           echo "*** library that it depends on before this library will be fully"
  2126.           echo "*** functional.  Installing it before continuing would be even better."
  2127.         fi
  2128.           else
  2129.         newdeplibs="$newdeplibs $i"
  2130.           fi
  2131.         done
  2132.       fi
  2133.       ;;
  2134.     file_magic*)
  2135.       set dummy $deplibs_check_method
  2136.       file_magic_regex="`expr \"$deplibs_check_method\" : \"$2 \(.*\)\"`"
  2137.       for a_deplib in $deplibs; do
  2138.         name="`expr $a_deplib : '-l\(.*\)'`"
  2139.         # If $name is empty we are operating on a -L argument.
  2140.         if test "$name" != "" ; then
  2141.           libname=`eval \\$echo \"$libname_spec\"`
  2142.           for i in $lib_search_path; do
  2143.             potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
  2144.             for potent_lib in $potential_libs; do
  2145.               # Follow soft links.
  2146.               if ls -lLd "$potent_lib" 2>/dev/null \
  2147.              | grep " -> " >/dev/null; then
  2148.             continue 
  2149.               fi
  2150.               # The statement above tries to avoid entering an
  2151.               # endless loop below, in case of cyclic links.
  2152.               # We might still enter an endless loop, since a link
  2153.               # loop can be closed while we follow links,
  2154.               # but so what?
  2155.               potlib="$potent_lib"
  2156.               while test -h "$potlib" 2>/dev/null; do
  2157.             potliblink=`ls -ld $potlib | sed 's/.* -> //'`
  2158.             case "$potliblink" in
  2159.             [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
  2160.             *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
  2161.             esac
  2162.               done
  2163.               if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
  2164.              | sed 10q \
  2165.              | egrep "$file_magic_regex" > /dev/null; then
  2166.             newdeplibs="$newdeplibs $a_deplib"
  2167.             a_deplib=""
  2168.             break 2
  2169.               fi
  2170.             done
  2171.           done
  2172.           if test -n "$a_deplib" ; then
  2173.         droppeddeps=yes
  2174.         echo
  2175.         echo "*** Warning: This library needs some functionality provided by $a_deplib."
  2176.         echo "*** I have the capability to make that library automatically link in when"
  2177.         echo "*** you link to this library.  But I can only do this if you have a"
  2178.         echo "*** shared version of the library, which you do not appear to have."
  2179.           fi
  2180.         else
  2181.           # Add a -L argument.
  2182.           newdeplibs="$newdeplibs $a_deplib"
  2183.         fi
  2184.       done # Gone through all deplibs.
  2185.       ;;
  2186.     none | unknown | *)
  2187.       newdeplibs=""
  2188.       if $echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
  2189.            -e 's/ -[LR][^ ]*//g' -e 's/[     ]//g' |
  2190.          grep . >/dev/null; then
  2191.         echo
  2192.         if test "X$deplibs_check_method" = "Xnone"; then
  2193.           echo "*** Warning: inter-library dependencies are not supported in this platform."
  2194.         else
  2195.           echo "*** Warning: inter-library dependencies are not known to be supported."
  2196.         fi
  2197.         echo "*** All declared inter-library dependencies are being dropped."
  2198.         droppeddeps=yes
  2199.       fi
  2200.       ;;
  2201.     esac
  2202.     versuffix=$versuffix_save
  2203.     major=$major_save
  2204.     release=$release_save
  2205.     libname=$libname_save
  2206.     name=$name_save
  2207.  
  2208.     if test "$droppeddeps" = yes; then
  2209.       if test "$module" = yes; then
  2210.         echo
  2211.         echo "*** Warning: libtool could not satisfy all declared inter-library"
  2212.         echo "*** dependencies of module $libname.  Therefore, libtool will create"
  2213.         echo "*** a static module, that should work as long as the dlopening"
  2214.         echo "*** application is linked with the -dlopen flag."
  2215.         if test -z "$global_symbol_pipe"; then
  2216.           echo
  2217.           echo "*** However, this would only work if libtool was able to extract symbol"
  2218.           echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
  2219.           echo "*** not find such a program.  So, this module is probably useless."
  2220.           echo "*** \`nm' from GNU binutils and a full rebuild may help."
  2221.         fi
  2222.         if test "$build_old_libs" = no; then
  2223.           oldlibs="$output_objdir/$libname.$libext"
  2224.           build_libtool_libs=module
  2225.           build_old_libs=yes
  2226.         else
  2227.           build_libtool_libs=no
  2228.         fi
  2229.       else
  2230.         echo "*** The inter-library dependencies that have been dropped here will be"
  2231.         echo "*** automatically added whenever a program is linked with this library"
  2232.         echo "*** or is declared to -dlopen it."
  2233.       fi
  2234.     fi
  2235.     # Done checking deplibs!
  2236.     deplibs=$newdeplibs
  2237.       fi
  2238.  
  2239.       # All the library-specific variables (install_libdir is set above).
  2240.       library_names=
  2241.       old_library=
  2242.       dlname=
  2243.       
  2244.       # Test again, we may have decided not to build it any more
  2245.       if test "$build_libtool_libs" = yes; then
  2246.     # Get the real and link names of the library.
  2247.     eval library_names=\"$library_names_spec\"
  2248.     set dummy $library_names
  2249.     realname="$2"
  2250.     shift; shift
  2251.  
  2252.     if test -n "$soname_spec"; then
  2253.       eval soname=\"$soname_spec\"
  2254.     else
  2255.       soname="$realname"
  2256.     fi
  2257.  
  2258.     lib="$output_objdir/$realname"
  2259.     for link
  2260.     do
  2261.       linknames="$linknames $link"
  2262.     done
  2263.  
  2264.     # Ensure that we have .o objects for linkers which dislike .lo
  2265.     # (e.g. aix) incase we are running --disable-static
  2266.     for obj in $libobjs; do
  2267.       oldobj=`$echo "X$obj" | $Xsed -e "$lo2o"`
  2268.       if test ! -f $oldobj; then
  2269.         $show "${LN_S} $obj $oldobj"
  2270.         $run ${LN_S} $obj $oldobj || exit $?
  2271.       fi
  2272.     done
  2273.  
  2274.     # Use standard objects if they are pic
  2275.     test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
  2276.  
  2277.     if test -n "$whole_archive_flag_spec"; then
  2278.       if test -n "$convenience"; then
  2279.         eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
  2280.       fi
  2281.     else
  2282.       gentop="$output_objdir/${outputname}x"
  2283.       $show "${rm}r $gentop"
  2284.       $run ${rm}r "$gentop"
  2285.       $show "mkdir $gentop"
  2286.       $run mkdir "$gentop"
  2287.       status=$?
  2288.       if test $status -ne 0 && test ! -d "$gentop"; then
  2289.         exit $status
  2290.       fi
  2291.       generated="$generated $gentop"
  2292.       
  2293.       for xlib in $convenience; do
  2294.         # Extract the objects.
  2295.         case "$xlib" in
  2296.         [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
  2297.         *) xabs=`pwd`"/$xlib" ;;
  2298.         esac
  2299.         xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
  2300.         xdir="$gentop/$xlib"
  2301.  
  2302.         $show "${rm}r $xdir"
  2303.         $run ${rm}r "$xdir"
  2304.         $show "mkdir $xdir"
  2305.         $run mkdir "$xdir"
  2306.         status=$?
  2307.         if test $status -ne 0 && test ! -d "$xdir"; then
  2308.           exit $status
  2309.         fi
  2310.         $show "(cd $xdir && $AR x $xabs)"
  2311.         $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
  2312.  
  2313.         libobjs="$libobjs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP`
  2314.       done
  2315.     fi
  2316.  
  2317.     if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
  2318.       eval flag=\"$thread_safe_flag_spec\"
  2319.       linkopts="$linkopts $flag"
  2320.     fi
  2321.  
  2322.     # Prepare the list of exported symbols
  2323.     if test -z "$export_symbols"; then
  2324.       if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
  2325.         $show "generating symbol list for \`$libname.la'"
  2326.         export_symbols="$output_objdir/$libname.exp"
  2327.         $run $rm $export_symbols
  2328.         eval cmds=\"$export_symbols_cmds\"
  2329.         IFS="${IFS=     }"; save_ifs="$IFS"; IFS='~'
  2330.         for cmd in $cmds; do
  2331.           IFS="$save_ifs"
  2332.           $show "$cmd"
  2333.           $run eval "$cmd" || exit $?
  2334.         done
  2335.         IFS="$save_ifs"
  2336.         if test -n "$export_symbols_regex"; then
  2337.           $show "egrep -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
  2338.           $run eval 'egrep -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
  2339.           $show "$mv \"${export_symbols}T\" \"$export_symbols\""
  2340.           $run eval '$mv "${export_symbols}T" "$export_symbols"'
  2341.         fi
  2342.       fi
  2343.     fi
  2344.  
  2345.     if test -n "$export_symbols" && test -n "$include_expsyms"; then
  2346.       $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
  2347.     fi
  2348.  
  2349.     # Do each of the archive commands.
  2350.     if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
  2351.       eval cmds=\"$archive_expsym_cmds\"
  2352.     else
  2353.       eval cmds=\"$archive_cmds\"
  2354.     fi
  2355.     IFS="${IFS=     }"; save_ifs="$IFS"; IFS='~'
  2356.     for cmd in $cmds; do
  2357.       IFS="$save_ifs"
  2358.       $show "$cmd"
  2359.       $run eval "$cmd" || exit $?
  2360.     done
  2361.     IFS="$save_ifs"
  2362.  
  2363.     # Create links to the real library.
  2364.     for linkname in $linknames; do
  2365.       if test "$realname" != "$linkname"; then
  2366.         $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)"
  2367.         $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $?
  2368.       fi
  2369.     done
  2370.  
  2371.     # If -module or -export-dynamic was specified, set the dlname.
  2372.     if test "$module" = yes || test "$export_dynamic" = yes; then
  2373.       # On all known operating systems, these are identical.
  2374.       dlname="$soname"
  2375.     fi
  2376.       fi
  2377.       ;;
  2378.  
  2379.     *.lo | *.o | *.obj)
  2380.       if test -n "$link_against_libtool_libs"; then
  2381.     $echo "$modename: error: cannot link libtool libraries into objects" 1>&2
  2382.     exit 1
  2383.       fi
  2384.  
  2385.       if test -n "$deplibs"; then
  2386.     $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
  2387.       fi
  2388.  
  2389.       if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
  2390.     $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
  2391.       fi
  2392.  
  2393.       if test -n "$rpath"; then
  2394.     $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
  2395.       fi
  2396.  
  2397.       if test -n "$xrpath"; then
  2398.     $echo "$modename: warning: \`-R' is ignored for objects" 1>&2
  2399.       fi
  2400.  
  2401.       if test -n "$vinfo"; then
  2402.     $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
  2403.       fi
  2404.  
  2405.       if test -n "$release"; then
  2406.     $echo "$modename: warning: \`-release' is ignored for objects" 1>&2
  2407.       fi
  2408.  
  2409.       case "$output" in
  2410.       *.lo)
  2411.     if test -n "$objs"; then
  2412.       $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
  2413.       exit 1
  2414.     fi
  2415.     libobj="$output"
  2416.     obj=`$echo "X$output" | $Xsed -e "$lo2o"`
  2417.     ;;
  2418.       *)
  2419.     libobj=
  2420.     obj="$output"
  2421.     ;;
  2422.       esac
  2423.  
  2424.       # Delete the old objects.
  2425.       $run $rm $obj $libobj
  2426.  
  2427.       # Create the old-style object.
  2428.       reload_objs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`
  2429.  
  2430.       output="$obj"
  2431.       eval cmds=\"$reload_cmds\"
  2432.       IFS="${IFS=     }"; save_ifs="$IFS"; IFS='~'
  2433.       for cmd in $cmds; do
  2434.     IFS="$save_ifs"
  2435.     $show "$cmd"
  2436.     $run eval "$cmd" || exit $?
  2437.       done
  2438.       IFS="$save_ifs"
  2439.  
  2440.       # Exit if we aren't doing a library object file.
  2441.       test -z "$libobj" && exit 0
  2442.  
  2443.       if test "$build_libtool_libs" != yes; then
  2444.     # Create an invalid libtool object if no PIC, so that we don't
  2445.     # accidentally link it into a program.
  2446.     $show "echo timestamp > $libobj"
  2447.     $run eval "echo timestamp > $libobj" || exit $?
  2448.     exit 0
  2449.       fi
  2450.  
  2451.       if test -n "$pic_flag"; then
  2452.     # Only do commands if we really have different PIC objects.
  2453.     reload_objs="$libobjs"
  2454.     output="$libobj"
  2455.     eval cmds=\"$reload_cmds\"
  2456.     IFS="${IFS=     }"; save_ifs="$IFS"; IFS='~'
  2457.     for cmd in $cmds; do
  2458.       IFS="$save_ifs"
  2459.       $show "$cmd"
  2460.       $run eval "$cmd" || exit $?
  2461.     done
  2462.     IFS="$save_ifs"
  2463.       else
  2464.     # Just create a symlink.
  2465.     $show $rm $libobj
  2466.     $run $rm $libobj
  2467.     $show "$LN_S $obj $libobj"
  2468.     $run $LN_S $obj $libobj || exit $?
  2469.       fi
  2470.  
  2471.       exit 0
  2472.       ;;
  2473.  
  2474.     # Anything else should be a program.
  2475.     *)
  2476.       if test -n "$vinfo"; then
  2477.     $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
  2478.       fi
  2479.  
  2480.       if test -n "$release"; then
  2481.     $echo "$modename: warning: \`-release' is ignored for programs" 1>&2
  2482.       fi
  2483.  
  2484.       if test "$preload" = yes; then
  2485.     if test "$dlopen" = unknown && test "$dlopen_self" = unknown &&
  2486.        test "$dlopen_self_static" = unknown; then
  2487.       $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
  2488.     fi 
  2489.       fi
  2490.     
  2491.       if test -n "$rpath$xrpath"; then
  2492.     # If the user specified any rpath flags, then add them.
  2493.     for libdir in $rpath $xrpath; do
  2494.       # This is the magic to use -rpath.
  2495.       case "$compile_rpath " in
  2496.       *" $libdir "*) ;;
  2497.       *) compile_rpath="$compile_rpath $libdir" ;;
  2498.       esac
  2499.       case "$finalize_rpath " in
  2500.       *" $libdir "*) ;;
  2501.       *) finalize_rpath="$finalize_rpath $libdir" ;;
  2502.       esac
  2503.     done
  2504.       fi
  2505.  
  2506.       # Now hardcode the library paths
  2507.       rpath=
  2508.       hardcode_libdirs=
  2509.       for libdir in $compile_rpath $finalize_rpath; do
  2510.     if test -n "$hardcode_libdir_flag_spec"; then
  2511.       if test -n "$hardcode_libdir_separator"; then
  2512.         if test -z "$hardcode_libdirs"; then
  2513.           hardcode_libdirs="$libdir"
  2514.         else
  2515.           # Just accumulate the unique libdirs.
  2516.           case "$hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator" in
  2517.           *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
  2518.         ;;
  2519.           *)
  2520.         hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
  2521.         ;;
  2522.           esac
  2523.         fi
  2524.       else
  2525.         eval flag=\"$hardcode_libdir_flag_spec\"
  2526.         rpath="$rpath $flag"
  2527.       fi
  2528.     elif test -n "$runpath_var"; then
  2529.       case "$perm_rpath " in
  2530.       *" $libdir "*) ;;
  2531.       *) perm_rpath="$perm_rpath $libdir" ;;
  2532.       esac
  2533.     fi
  2534.       done
  2535.       # Substitute the hardcoded libdirs into the rpath.
  2536.       if test -n "$hardcode_libdir_separator" &&
  2537.      test -n "$hardcode_libdirs"; then
  2538.     libdir="$hardcode_libdirs"
  2539.     eval rpath=\" $hardcode_libdir_flag_spec\"
  2540.       fi
  2541.       compile_rpath="$rpath"
  2542.  
  2543.       rpath=
  2544.       hardcode_libdirs=
  2545.       for libdir in $finalize_rpath; do
  2546.     if test -n "$hardcode_libdir_flag_spec"; then
  2547.       if test -n "$hardcode_libdir_separator"; then
  2548.         if test -z "$hardcode_libdirs"; then
  2549.           hardcode_libdirs="$libdir"
  2550.         else
  2551.           # Just accumulate the unique libdirs.
  2552.           case "$hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator" in
  2553.           *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
  2554.         ;;
  2555.           *)
  2556.         hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
  2557.         ;;
  2558.           esac
  2559.         fi
  2560.       else
  2561.         eval flag=\"$hardcode_libdir_flag_spec\"
  2562.         rpath="$rpath $flag"
  2563.       fi
  2564.     elif test -n "$runpath_var"; then
  2565.       case "$finalize_perm_rpath " in
  2566.       *" $libdir "*) ;;
  2567.       *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
  2568.       esac
  2569.     fi
  2570.       done
  2571.       # Substitute the hardcoded libdirs into the rpath.
  2572.       if test -n "$hardcode_libdir_separator" &&
  2573.      test -n "$hardcode_libdirs"; then
  2574.     libdir="$hardcode_libdirs"
  2575.     eval rpath=\" $hardcode_libdir_flag_spec\"
  2576.       fi
  2577.       finalize_rpath="$rpath"
  2578.  
  2579.       output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
  2580.       if test "X$output_objdir" = "X$output"; then
  2581.     output_objdir="$objdir"
  2582.       else
  2583.     output_objdir="$output_objdir/$objdir"
  2584.       fi
  2585.  
  2586.       # Create the binary in the object directory, then wrap it.
  2587.       if test ! -d $output_objdir; then
  2588.     $show "$mkdir $output_objdir"
  2589.     $run $mkdir $output_objdir
  2590.     status=$?
  2591.     if test $status -ne 0 && test ! -d $output_objdir; then
  2592.       exit $status
  2593.     fi
  2594.       fi
  2595.  
  2596.       if test -n "$libobjs" && test "$build_old_libs" = yes; then
  2597.     # Transform all the library objects into standard objects.
  2598.     compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
  2599.     finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
  2600.       fi
  2601.  
  2602.       dlsyms=
  2603.       if test -n "$dlfiles$dlprefiles" || test "$dlself" = yes; then
  2604.     if test -n "$NM" && test -n "$global_symbol_pipe"; then
  2605.       dlsyms="${outputname}S.c"
  2606.     else
  2607.       $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
  2608.     fi
  2609.       fi
  2610.  
  2611.       if test -n "$dlsyms"; then
  2612.     case "$dlsyms" in
  2613.     "") ;;
  2614.     *.c)
  2615.       # Discover the nlist of each of the dlfiles.
  2616.       nlist="$output_objdir/${outputname}.nm"
  2617.  
  2618.       $show "$rm $nlist ${nlist}S ${nlist}T"
  2619.       $run $rm "$nlist" "${nlist}S" "${nlist}T"
  2620.  
  2621.       # Parse the name list into a source file.
  2622.       $show "creating $output_objdir/$dlsyms"
  2623.  
  2624.       test -z "$run" && $echo > "$output_objdir/$dlsyms" "\
  2625. /* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */
  2626. /* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */
  2627.  
  2628. #ifdef __cplusplus
  2629. extern \"C\" {
  2630. #endif
  2631.  
  2632. /* Prevent the only kind of declaration conflicts we can make. */
  2633. #define lt_preloaded_symbols some_other_symbol
  2634.  
  2635. /* External symbol declarations for the compiler. */\
  2636. "
  2637.  
  2638.       if test "$dlself" = yes; then
  2639.         $show "generating symbol list for \`$output'"
  2640.  
  2641.         test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
  2642.  
  2643.         # Add our own program objects to the symbol list.
  2644.         progfiles=`$echo "X$objs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
  2645.         for arg in $progfiles; do
  2646.           $show "extracting global C symbols from \`$arg'"
  2647.           $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
  2648.         done
  2649.  
  2650.         if test -n "$exclude_expsyms"; then
  2651.           $run eval 'egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
  2652.           $run eval '$mv "$nlist"T "$nlist"'
  2653.         fi
  2654.         
  2655.         if test -n "$export_symbols_regex"; then
  2656.           $run eval 'egrep -e "$export_symbols_regex" "$nlist" > "$nlist"T'
  2657.           $run eval '$mv "$nlist"T "$nlist"'
  2658.         fi
  2659.  
  2660.         # Prepare the list of exported symbols
  2661.         if test -z "$export_symbols"; then
  2662.           export_symbols="$output_objdir/$output.exp"
  2663.           $run $rm $export_symbols
  2664.           $run eval "sed -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
  2665.         else
  2666.           $run eval "sed -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"'
  2667.           $run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T'
  2668.           $run eval 'mv "$nlist"T "$nlist"'
  2669.         fi
  2670.       fi
  2671.  
  2672.       for arg in $dlprefiles; do
  2673.         $show "extracting global C symbols from \`$arg'"
  2674.         name=`echo "$arg" | sed -e 's%^.*/%%'`
  2675.         $run eval 'echo ": $name " >> "$nlist"'
  2676.         $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
  2677.       done
  2678.  
  2679.       if test -z "$run"; then
  2680.         # Make sure we have at least an empty file.
  2681.         test -f "$nlist" || : > "$nlist"
  2682.  
  2683.         if test -n "$exclude_expsyms"; then
  2684.           egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
  2685.           $mv "$nlist"T "$nlist"
  2686.         fi
  2687.  
  2688.         # Try sorting and uniquifying the output.
  2689.         if grep -v "^: " < "$nlist" | sort +2 | uniq > "$nlist"S; then
  2690.           :
  2691.         else
  2692.           grep -v "^: " < "$nlist" > "$nlist"S
  2693.         fi
  2694.  
  2695.         if test -f "$nlist"S; then
  2696.           eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
  2697.         else
  2698.           echo '/* NONE */' >> "$output_objdir/$dlsyms"
  2699.         fi
  2700.  
  2701.         $echo >> "$output_objdir/$dlsyms" "\
  2702.  
  2703. #undef lt_preloaded_symbols
  2704.  
  2705. #if defined (__STDC__) && __STDC__
  2706. # define lt_ptr_t void *
  2707. #else
  2708. # define lt_ptr_t char *
  2709. # define const
  2710. #endif
  2711.  
  2712. /* The mapping between symbol names and symbols. */
  2713. const struct {
  2714.   const char *name;
  2715.   lt_ptr_t address;
  2716. }
  2717. lt_preloaded_symbols[] =
  2718. {\
  2719. "
  2720.  
  2721.         sed -n -e 's/^: \([^ ]*\) $/  {\"\1\", (lt_ptr_t) 0},/p' \
  2722.         -e 's/^. \([^ ]*\) \([^ ]*\)$/  {"\2", (lt_ptr_t) \&\2},/p' \
  2723.           < "$nlist" >> "$output_objdir/$dlsyms"
  2724.  
  2725.         $echo >> "$output_objdir/$dlsyms" "\
  2726.   {0, (lt_ptr_t) 0}
  2727. };
  2728.  
  2729. /* This works around a problem in FreeBSD linker */
  2730. #ifdef FREEBSD_WORKAROUND
  2731. static const void *lt_preloaded_setup() {
  2732.   return lt_preloaded_symbols;
  2733. }
  2734. #endif
  2735.  
  2736. #ifdef __cplusplus
  2737. }
  2738. #endif\
  2739. "
  2740.       fi
  2741.  
  2742.       pic_flag_for_symtable=
  2743.       case "$host" in
  2744.       # compiling the symbol table file with pic_flag works around
  2745.       # a FreeBSD bug that causes programs to crash when -lm is
  2746.       # linked before any other PIC object.  But we must not use
  2747.       # pic_flag when linking with -static.  The problem exists in
  2748.       # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
  2749.       *-*-freebsd2*|*-*-freebsd3.0*)
  2750.         case "$compile_command " in
  2751.         *" -static "*) ;;
  2752.         *) pic_flag_for_symtable=" $pic_flag -DPIC -DFREEBSD_WORKAROUND";;
  2753.         esac
  2754.       esac
  2755.  
  2756.       # Now compile the dynamic symbol file.
  2757.       $show "(cd $output_objdir && $C_compiler -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
  2758.       $run eval '(cd $output_objdir && $C_compiler -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
  2759.  
  2760.       # Clean up the generated files.
  2761.       $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
  2762.       $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
  2763.  
  2764.       # Transform the symbol file into the correct name.
  2765.       compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
  2766.       finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
  2767.       ;;
  2768.     *)
  2769.       $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
  2770.       exit 1
  2771.       ;;
  2772.     esac
  2773.       else
  2774.     # We keep going just in case the user didn't refer to
  2775.     # lt_preloaded_symbols.  The linker will fail if global_symbol_pipe
  2776.     # really was required.
  2777.  
  2778.     # Nullify the symbol file.
  2779.     compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
  2780.     finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
  2781.       fi
  2782.  
  2783.       if test -z "$link_against_libtool_libs" || test "$build_libtool_libs" != yes; then
  2784.     # Replace the output file specification.
  2785.     compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
  2786.     link_command="$compile_command$compile_rpath"
  2787.  
  2788.     # We have no uninstalled library dependencies, so finalize right now.
  2789.     $show "$link_command"
  2790.     $run eval "$link_command"
  2791.     status=$?
  2792.     
  2793.     # Delete the generated files.
  2794.     if test -n "$dlsyms"; then
  2795.       $show "$rm $output_objdir/${outputname}S.${objext}"
  2796.       $run $rm "$output_objdir/${outputname}S.${objext}"
  2797.     fi
  2798.  
  2799.     exit $status
  2800.       fi
  2801.  
  2802.       if test -n "$shlibpath_var"; then
  2803.     # We should set the shlibpath_var
  2804.     rpath=
  2805.     for dir in $temp_rpath; do
  2806.       case "$dir" in
  2807.       [\\/]* | [A-Za-z]:[\\/]*)
  2808.         # Absolute path.
  2809.         rpath="$rpath$dir:"
  2810.         ;;
  2811.       *)
  2812.         # Relative path: add a thisdir entry.
  2813.         rpath="$rpath\$thisdir/$dir:"
  2814.         ;;
  2815.       esac
  2816.     done
  2817.     temp_rpath="$rpath"
  2818.       fi
  2819.  
  2820.       if test -n "$compile_shlibpath$finalize_shlibpath"; then
  2821.     compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
  2822.       fi
  2823.       if test -n "$finalize_shlibpath"; then
  2824.     finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
  2825.       fi
  2826.  
  2827.       compile_var=
  2828.       finalize_var=
  2829.       if test -n "$runpath_var"; then
  2830.     if test -n "$perm_rpath"; then
  2831.       # We should set the runpath_var.
  2832.       rpath=
  2833.       for dir in $perm_rpath; do
  2834.         rpath="$rpath$dir:"
  2835.       done
  2836.       compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
  2837.     fi
  2838.     if test -n "$finalize_perm_rpath"; then
  2839.       # We should set the runpath_var.
  2840.       rpath=
  2841.       for dir in $finalize_perm_rpath; do
  2842.         rpath="$rpath$dir:"
  2843.       done
  2844.       finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
  2845.     fi
  2846.       fi
  2847.  
  2848.       if test "$hardcode_action" = relink; then
  2849.     # Fast installation is not supported
  2850.     link_command="$compile_var$compile_command$compile_rpath"
  2851.     relink_command="$finalize_var$finalize_command$finalize_rpath"
  2852.     
  2853.     $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
  2854.     $echo "$modename: \`$output' will be relinked during installation" 1>&2
  2855.       else
  2856.     if test "$fast_install" != no; then
  2857.       link_command="$finalize_var$compile_command$finalize_rpath"
  2858.       if test "$fast_install" = yes; then
  2859.         relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
  2860.       else
  2861.         # fast_install is set to needless
  2862.         relink_command=
  2863.       fi
  2864.     else
  2865.       link_command="$compile_var$compile_command$compile_rpath"
  2866.       relink_command="$finalize_var$finalize_command$finalize_rpath"
  2867.     fi
  2868.       fi
  2869.  
  2870.       # Replace the output file specification.
  2871.       link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
  2872.       
  2873.       # Delete the old output files.
  2874.       $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname
  2875.  
  2876.       $show "$link_command"
  2877.       $run eval "$link_command" || exit $?
  2878.  
  2879.       # Now create the wrapper script.
  2880.       $show "creating $output"
  2881.  
  2882.       # Quote the relink command for shipping.
  2883.       if test -n "$relink_command"; then
  2884.     relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
  2885.       fi
  2886.  
  2887.       # Quote $echo for shipping.
  2888.       if test "X$echo" = "X$SHELL $0 --fallback-echo"; then
  2889.     case "$0" in
  2890.     [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $0 --fallback-echo";;
  2891.     *) qecho="$SHELL `pwd`/$0 --fallback-echo";;
  2892.     esac
  2893.     qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
  2894.       else
  2895.     qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
  2896.       fi
  2897.  
  2898.       # Only actually do things if our run command is non-null.
  2899.       if test -z "$run"; then
  2900.     # win32 will think the script is a binary if it has
  2901.     # a .exe suffix, so we strip it off here.
  2902.     case $output in
  2903.       *.exe) output=`echo $output|sed 's,.exe$,,'` ;;
  2904.     esac
  2905.     $rm $output
  2906.     trap "$rm $output; exit 1" 1 2 15
  2907.  
  2908.     $echo > $output "\
  2909. #! $SHELL
  2910.  
  2911. # $output - temporary wrapper script for $objdir/$outputname
  2912. # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
  2913. #
  2914. # The $output program cannot be directly executed until all the libtool
  2915. # libraries that it depends on are installed.
  2916. #
  2917. # This wrapper script should never be moved out of the build directory.
  2918. # If it is, it will not operate correctly.
  2919.  
  2920. # Sed substitution that helps us do robust quoting.  It backslashifies
  2921. # metacharacters that are still active within double-quoted strings.
  2922. Xsed='sed -e 1s/^X//'
  2923. sed_quote_subst='$sed_quote_subst'
  2924.  
  2925. # The HP-UX ksh and POSIX shell print the target directory to stdout
  2926. # if CDPATH is set.
  2927. if test \"\${CDPATH+set}\" = set; then CDPATH=; export CDPATH; fi
  2928.  
  2929. relink_command=\"$relink_command\"
  2930.  
  2931. # This environment variable determines our operation mode.
  2932. if test \"\$libtool_install_magic\" = \"$magic\"; then
  2933.   # install mode needs the following variable:
  2934.   link_against_libtool_libs='$link_against_libtool_libs'
  2935. else
  2936.   # When we are sourced in execute mode, \$file and \$echo are already set.
  2937.   if test \"\$libtool_execute_magic\" != \"$magic\"; then
  2938.     echo=\"$qecho\"
  2939.     file=\"\$0\"
  2940.     # Make sure echo works.
  2941.     if test \"X\$1\" = X--no-reexec; then
  2942.       # Discard the --no-reexec flag, and continue.
  2943.       shift
  2944.     elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then
  2945.       # Yippee, \$echo works!
  2946.       :
  2947.     else
  2948.       # Restart under the correct shell, and then maybe \$echo will work.
  2949.       exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
  2950.     fi
  2951.   fi\
  2952. "
  2953.     $echo >> $output "\
  2954.  
  2955.   # Find the directory that this script lives in.
  2956.   thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
  2957.   test \"x\$thisdir\" = \"x\$file\" && thisdir=.
  2958.  
  2959.   # Follow symbolic links until we get to the real thisdir.
  2960.   file=\`ls -ld \"\$file\" | sed -n 's/.*-> //p'\`
  2961.   while test -n \"\$file\"; do
  2962.     destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
  2963.  
  2964.     # If there was a directory component, then change thisdir.
  2965.     if test \"x\$destdir\" != \"x\$file\"; then
  2966.       case \"\$destdir\" in
  2967.       [\\/]* | [A-Za-z]:[\\/]*) thisdir=\"\$destdir\" ;;
  2968.       *) thisdir=\"\$thisdir/\$destdir\" ;;
  2969.       esac
  2970.     fi
  2971.  
  2972.     file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
  2973.     file=\`ls -ld \"\$thisdir/\$file\" | sed -n 's/.*-> //p'\`
  2974.   done
  2975.  
  2976.   # Try to get the absolute directory name.
  2977.   absdir=\`cd \"\$thisdir\" && pwd\`
  2978.   test -n \"\$absdir\" && thisdir=\"\$absdir\"
  2979. "
  2980.  
  2981.     if test "$fast_install" = yes; then
  2982.       echo >> $output "\
  2983.   program=lt-'$outputname'
  2984.   progdir=\"\$thisdir/$objdir\"
  2985.   
  2986.   if test ! -f \"\$progdir/\$program\" || \\
  2987.      { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | sed 1q\`; \\
  2988.        test \"X\$file\" != \"X\$progdir/\$program\"; }; then
  2989.  
  2990.     file=\"\$\$-\$program\"
  2991.  
  2992.     if test ! -d \"\$progdir\"; then
  2993.       $mkdir \"\$progdir\"
  2994.     else
  2995.       $rm \"\$progdir/\$file\"
  2996.     fi"
  2997.  
  2998.       echo >> $output "\
  2999.  
  3000.     # relink executable if necessary
  3001.     if test -n \"\$relink_command\"; then
  3002.       if (cd \"\$thisdir\" && eval \$relink_command); then :
  3003.       else
  3004.     $rm \"\$progdir/\$file\"
  3005.     exit 1
  3006.       fi
  3007.     fi
  3008.  
  3009.     $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
  3010.     { $rm \"\$progdir/\$program\";
  3011.       $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
  3012.     $rm \"\$progdir/\$file\"
  3013.   fi"
  3014.     else
  3015.       echo >> $output "\
  3016.   program='$outputname'
  3017.   progdir=\"\$thisdir/$objdir\"
  3018. "
  3019.     fi
  3020.  
  3021.     echo >> $output "\
  3022.  
  3023.   if test -f \"\$progdir/\$program\"; then"
  3024.  
  3025.     # Export our shlibpath_var if we have one.
  3026.     if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
  3027.       $echo >> $output "\
  3028.     # Add our own library path to $shlibpath_var
  3029.     $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
  3030.  
  3031.     # Some systems cannot cope with colon-terminated $shlibpath_var
  3032.     # The second colon is a workaround for a bug in BeOS R4 sed
  3033.     $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
  3034.  
  3035.     export $shlibpath_var
  3036. "
  3037.     fi
  3038.  
  3039.     # fixup the dll searchpath if we need to.
  3040.     if test -n "$dllsearchpath"; then
  3041.       $echo >> $output "\
  3042.     # Add the dll search path components to the executable PATH
  3043.     PATH=$dllsearchpath:\$PATH
  3044. "
  3045.     fi
  3046.  
  3047.     $echo >> $output "\
  3048.     if test \"\$libtool_execute_magic\" != \"$magic\"; then
  3049.       # Run the actual program with our arguments.
  3050. "
  3051.     case $host in
  3052.     *-*-cygwin* | *-*-mingw | *-*-os2*)
  3053.       # win32 systems need to use the prog path for dll
  3054.       # lookup to work
  3055.       $echo >> $output "\
  3056.       exec \$progdir\\\\\$program \${1+\"\$@\"}
  3057. "
  3058.       ;;
  3059.     *)
  3060.       $echo >> $output "\
  3061.       # Export the path to the program.
  3062.       PATH=\"\$progdir:\$PATH\"
  3063.       export PATH
  3064.  
  3065.       exec \$program \${1+\"\$@\"}
  3066. "
  3067.       ;;
  3068.     esac
  3069.     $echo >> $output "\
  3070.       \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
  3071.       exit 1
  3072.     fi
  3073.   else
  3074.     # The program doesn't exist.
  3075.     \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2
  3076.     \$echo \"This script is just a wrapper for \$program.\" 1>&2
  3077.     echo \"See the $PACKAGE documentation for more information.\" 1>&2
  3078.     exit 1
  3079.   fi
  3080. fi\
  3081. "
  3082.     chmod +x $output
  3083.       fi
  3084.       exit 0
  3085.       ;;
  3086.     esac
  3087.  
  3088.     # See if we need to build an old-fashioned archive.
  3089.     for oldlib in $oldlibs; do
  3090.  
  3091.       if test "$build_libtool_libs" = convenience; then
  3092.     oldobjs="$libobjs_save"
  3093.     addlibs="$convenience"
  3094.     build_libtool_libs=no
  3095.       else
  3096.     if test "$build_libtool_libs" = module; then
  3097.       oldobjs="$libobjs_save"
  3098.       build_libtool_libs=no
  3099.     else
  3100.       oldobjs="$objs "`$echo "X$libobjs_save" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`
  3101.     fi
  3102.     addlibs="$old_convenience"
  3103.       fi
  3104.  
  3105.       if test -n "$addlibs"; then
  3106.     gentop="$output_objdir/${outputname}x"
  3107.     $show "${rm}r $gentop"
  3108.     $run ${rm}r "$gentop"
  3109.     $show "mkdir $gentop"
  3110.     $run mkdir "$gentop"
  3111.     status=$?
  3112.     if test $status -ne 0 && test ! -d "$gentop"; then
  3113.       exit $status
  3114.     fi
  3115.     generated="$generated $gentop"
  3116.       
  3117.     # Add in members from convenience archives.
  3118.     for xlib in $addlibs; do
  3119.       # Extract the objects.
  3120.       case "$xlib" in
  3121.       [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
  3122.       *) xabs=`pwd`"/$xlib" ;;
  3123.       esac
  3124.       xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
  3125.       xdir="$gentop/$xlib"
  3126.  
  3127.       $show "${rm}r $xdir"
  3128.       $run ${rm}r "$xdir"
  3129.       $show "mkdir $xdir"
  3130.       $run mkdir "$xdir"
  3131.       status=$?
  3132.       if test $status -ne 0 && test ! -d "$xdir"; then
  3133.         exit $status
  3134.       fi
  3135.       $show "(cd $xdir && $AR x $xabs)"
  3136.       $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
  3137.  
  3138.       oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP`
  3139.     done
  3140.       fi
  3141.  
  3142.       # Do each command in the archive commands.
  3143.       if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
  3144.     eval cmds=\"$old_archive_from_new_cmds\"
  3145.       else
  3146.     # Ensure that we have .o objects in place incase we decided
  3147.     # not to build a shared library, and have fallen back to building
  3148.     # static libs even though --disable-static was passed!
  3149.     for oldobj in $oldobjs; do
  3150.       if test ! -f $oldobj; then
  3151.         obj=`$echo "X$oldobj" | $Xsed -e "$o2lo"`
  3152.         $show "${LN_S} $obj $oldobj"
  3153.         $run ${LN_S} $obj $oldobj || exit $?
  3154.       fi
  3155.     done
  3156.  
  3157.     eval cmds=\"$old_archive_cmds\"
  3158.       fi
  3159.       IFS="${IFS=     }"; save_ifs="$IFS"; IFS='~'
  3160.       for cmd in $cmds; do
  3161.     IFS="$save_ifs"
  3162.     $show "$cmd"
  3163.     $run eval "$cmd" || exit $?
  3164.       done
  3165.       IFS="$save_ifs"
  3166.     done
  3167.  
  3168.     if test -n "$generated"; then
  3169.       $show "${rm}r$generated"
  3170.       $run ${rm}r$generated
  3171.     fi
  3172.  
  3173.     # Now create the libtool archive.
  3174.     case "$output" in
  3175.     *.la)
  3176.       old_library=
  3177.       test "$build_old_libs" = yes && old_library="$libname.$libext"
  3178.       $show "creating $output"
  3179.  
  3180.       if test -n "$xrpath"; then
  3181.     temp_xrpath=
  3182.     for libdir in $xrpath; do
  3183.       temp_xrpath="$temp_xrpath -R$libdir"
  3184.     done
  3185.     dependency_libs="$temp_xrpath $dependency_libs"
  3186.       fi
  3187.  
  3188.       # Only create the output if not a dry run.
  3189.       if test -z "$run"; then
  3190.     for installed in no yes; do
  3191.       if test "$installed" = yes; then
  3192.         if test -z "$install_libdir"; then
  3193.           break
  3194.         fi
  3195.         output="$output_objdir/$outputname"i
  3196.       fi
  3197.       $rm $output
  3198.       $echo > $output "\
  3199. # $outputname - a libtool library file
  3200. # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
  3201. #
  3202. # Please DO NOT delete this file!
  3203. # It is necessary for linking the library.
  3204.  
  3205. # The name that we can dlopen(3).
  3206. dlname='$dlname'
  3207.  
  3208. # Names of this library.
  3209. library_names='$library_names'
  3210.  
  3211. # The name of the static archive.
  3212. old_library='$old_library'
  3213.  
  3214. # Libraries that this one depends upon.
  3215. dependency_libs='$dependency_libs'
  3216.  
  3217. # Version information for $libname.
  3218. current=$current
  3219. age=$age
  3220. revision=$revision
  3221.  
  3222. # Is this an already installed library?
  3223. installed=$installed
  3224.  
  3225. # Directory that this library needs to be installed in:
  3226. libdir='$install_libdir'\
  3227. "
  3228.     done
  3229.       fi
  3230.  
  3231.       # Do a symbolic link so that the libtool archive can be found in
  3232.       # LD_LIBRARY_PATH before the program is installed.
  3233.       $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
  3234.       $run eval "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)" || exit $?
  3235.       ;;
  3236.     esac
  3237.     exit 0
  3238.     ;;
  3239.  
  3240.   # libtool install mode
  3241.   install)
  3242.     modename="$modename: install"
  3243.  
  3244.     # There may be an optional sh(1) argument at the beginning of
  3245.     # install_prog (especially on Windows NT).
  3246.     if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh; then
  3247.       # Aesthetically quote it.
  3248.       arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
  3249.       case "$arg" in
  3250.       *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \    ]*|*]*)
  3251.     arg="\"$arg\""
  3252.     ;;
  3253.       esac
  3254.       install_prog="$arg "
  3255.       arg="$1"
  3256.       shift
  3257.     else
  3258.       install_prog=
  3259.       arg="$nonopt"
  3260.     fi
  3261.  
  3262.     # The real first argument should be the name of the installation program.
  3263.     # Aesthetically quote it.
  3264.     arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
  3265.     case "$arg" in
  3266.     *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \    ]*|*]*)
  3267.       arg="\"$arg\""
  3268.       ;;
  3269.     esac
  3270.     install_prog="$install_prog$arg"
  3271.  
  3272.     # We need to accept at least all the BSD install flags.
  3273.     dest=
  3274.     files=
  3275.     opts=
  3276.     prev=
  3277.     install_type=
  3278.     isdir=no
  3279.     stripme=
  3280.     for arg
  3281.     do
  3282.       if test -n "$dest"; then
  3283.     files="$files $dest"
  3284.     dest="$arg"
  3285.     continue
  3286.       fi
  3287.  
  3288.       case "$arg" in
  3289.       -d) isdir=yes ;;
  3290.       -f) prev="-f" ;;
  3291.       -g) prev="-g" ;;
  3292.       -m) prev="-m" ;;
  3293.       -o) prev="-o" ;;
  3294.       -s)
  3295.     stripme=" -s"
  3296.     continue
  3297.     ;;
  3298.       -*) ;;
  3299.  
  3300.       *)
  3301.     # If the previous option needed an argument, then skip it.
  3302.     if test -n "$prev"; then
  3303.       prev=
  3304.     else
  3305.       dest="$arg"
  3306.       continue
  3307.     fi
  3308.     ;;
  3309.       esac
  3310.  
  3311.       # Aesthetically quote the argument.
  3312.       arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
  3313.       case "$arg" in
  3314.       *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \    ]*|*]*)
  3315.     arg="\"$arg\""
  3316.     ;;
  3317.       esac
  3318.       install_prog="$install_prog $arg"
  3319.     done
  3320.  
  3321.     if test -z "$install_prog"; then
  3322.       $echo "$modename: you must specify an install program" 1>&2
  3323.       $echo "$help" 1>&2
  3324.       exit 1
  3325.     fi
  3326.  
  3327.     if test -n "$prev"; then
  3328.       $echo "$modename: the \`$prev' option requires an argument" 1>&2
  3329.       $echo "$help" 1>&2
  3330.       exit 1
  3331.     fi
  3332.  
  3333.     if test -z "$files"; then
  3334.       if test -z "$dest"; then
  3335.     $echo "$modename: no file or destination specified" 1>&2
  3336.       else
  3337.     $echo "$modename: you must specify a destination" 1>&2
  3338.       fi
  3339.       $echo "$help" 1>&2
  3340.       exit 1
  3341.     fi
  3342.  
  3343.     # Strip any trailing slash from the destination.
  3344.     dest=`$echo "X$dest" | $Xsed -e 's%/$%%'`
  3345.  
  3346.     # Check to see that the destination is a directory.
  3347.     test -d "$dest" && isdir=yes
  3348.     if test "$isdir" = yes; then
  3349.       destdir="$dest"
  3350.       destname=
  3351.     else
  3352.       destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'`
  3353.       test "X$destdir" = "X$dest" && destdir=.
  3354.       destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
  3355.  
  3356.       # Not a directory, so check to see that there is only one file specified.
  3357.       set dummy $files
  3358.       if test $# -gt 2; then
  3359.     $echo "$modename: \`$dest' is not a directory" 1>&2
  3360.     $echo "$help" 1>&2
  3361.     exit 1
  3362.       fi
  3363.     fi
  3364.     case "$destdir" in
  3365.     [\\/]* | [A-Za-z]:[\\/]*) ;;
  3366.     *)
  3367.       for file in $files; do
  3368.     case "$file" in
  3369.     *.lo) ;;
  3370.     *)
  3371.       $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
  3372.       $echo "$help" 1>&2
  3373.       exit 1
  3374.       ;;
  3375.     esac
  3376.       done
  3377.       ;;
  3378.     esac
  3379.  
  3380.     # This variable tells wrapper scripts just to set variables rather
  3381.     # than running their programs.
  3382.     libtool_install_magic="$magic"
  3383.  
  3384.     staticlibs=
  3385.     future_libdirs=
  3386.     current_libdirs=
  3387.     for file in $files; do
  3388.  
  3389.       # Do each installation.
  3390.       case "$file" in
  3391.       *.a | *.lib)
  3392.     # Do the static libraries later.
  3393.     staticlibs="$staticlibs $file"
  3394.     ;;
  3395.  
  3396.       *.la)
  3397.     # Check to see that this really is a libtool archive.
  3398.     if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
  3399.     else
  3400.       $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
  3401.       $echo "$help" 1>&2
  3402.       exit 1
  3403.     fi
  3404.  
  3405.     library_names=
  3406.     old_library=
  3407.     # If there is no directory component, then add one.
  3408.     case "$file" in
  3409.     */* | *\\*) . $file ;;
  3410.     *) . ./$file ;;
  3411.     esac
  3412.  
  3413.     # Add the libdir to current_libdirs if it is the destination.
  3414.     if test "X$destdir" = "X$libdir"; then
  3415.       case "$current_libdirs " in
  3416.       *" $libdir "*) ;;
  3417.       *) current_libdirs="$current_libdirs $libdir" ;;
  3418.       esac
  3419.     else
  3420.       # Note the libdir as a future libdir.
  3421.       case "$future_libdirs " in
  3422.       *" $libdir "*) ;;
  3423.       *) future_libdirs="$future_libdirs $libdir" ;;
  3424.       esac
  3425.     fi
  3426.  
  3427.     dir="`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/"
  3428.     test "X$dir" = "X$file/" && dir=
  3429.     dir="$dir$objdir"
  3430.  
  3431.     # See the names of the shared library.
  3432.     set dummy $library_names
  3433.     if test -n "$2"; then
  3434.       realname="$2"
  3435.       shift
  3436.       shift
  3437.  
  3438.       # Install the shared library and build the symlinks.
  3439.       $show "$install_prog $dir/$realname $destdir/$realname"
  3440.       $run eval "$install_prog $dir/$realname $destdir/$realname" || exit $?
  3441.       test "X$dlname" = "X$realname" && dlname=
  3442.  
  3443.       if test $# -gt 0; then
  3444.         # Delete the old symlinks, and create new ones.
  3445.         for linkname
  3446.         do
  3447.           test "X$dlname" = "X$linkname" && dlname=
  3448.           if test "$linkname" != "$realname"; then
  3449.         $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
  3450.         $run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
  3451.           fi
  3452.         done
  3453.       fi
  3454.  
  3455.       if test -n "$dlname"; then
  3456.         # Install the dynamically-loadable library.
  3457.         $show "$install_prog $dir/$dlname $destdir/$dlname"
  3458.         $run eval "$install_prog $dir/$dlname $destdir/$dlname" || exit $?
  3459.       fi
  3460.  
  3461.       # Do each command in the postinstall commands.
  3462.       lib="$destdir/$realname"
  3463.       eval cmds=\"$postinstall_cmds\"
  3464.       IFS="${IFS=     }"; save_ifs="$IFS"; IFS='~'
  3465.       for cmd in $cmds; do
  3466.         IFS="$save_ifs"
  3467.         $show "$cmd"
  3468.         $run eval "$cmd" || exit $?
  3469.       done
  3470.       IFS="$save_ifs"
  3471.     fi
  3472.  
  3473.     # Install the pseudo-library for information purposes.
  3474.     name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
  3475.     instname="$dir/$name"i
  3476.     $show "$install_prog $instname $destdir/$name"
  3477.     $run eval "$install_prog $instname $destdir/$name" || exit $?
  3478.  
  3479.     # Maybe install the static library, too.
  3480.     test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
  3481.     ;;
  3482.  
  3483.       *.lo)
  3484.     # Install (i.e. copy) a libtool object.
  3485.  
  3486.     # Figure out destination file name, if it wasn't already specified.
  3487.     if test -n "$destname"; then
  3488.       destfile="$destdir/$destname"
  3489.     else
  3490.       destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
  3491.       destfile="$destdir/$destfile"
  3492.     fi
  3493.  
  3494.     # Deduce the name of the destination old-style object file.
  3495.     case "$destfile" in
  3496.     *.lo)
  3497.       staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"`
  3498.       ;;
  3499.     *.o | *.obj)
  3500.       staticdest="$destfile"
  3501.       destfile=
  3502.       ;;
  3503.     *)
  3504.       $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
  3505.       $echo "$help" 1>&2
  3506.       exit 1
  3507.       ;;
  3508.     esac
  3509.  
  3510.     # Install the libtool object if requested.
  3511.     if test -n "$destfile"; then
  3512.       $show "$install_prog $file $destfile"
  3513.       $run eval "$install_prog $file $destfile" || exit $?
  3514.     fi
  3515.  
  3516.     # Install the old object if enabled.
  3517.     if test "$build_old_libs" = yes; then
  3518.       # Deduce the name of the old-style object file.
  3519.       staticobj=`$echo "X$file" | $Xsed -e "$lo2o"`
  3520.  
  3521.       $show "$install_prog $staticobj $staticdest"
  3522.       $run eval "$install_prog \$staticobj \$staticdest" || exit $?
  3523.     fi
  3524.     exit 0
  3525.     ;;
  3526.  
  3527.       *)
  3528.     # Figure out destination file name, if it wasn't already specified.
  3529.     if test -n "$destname"; then
  3530.       destfile="$destdir/$destname"
  3531.     else
  3532.       destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
  3533.       destfile="$destdir/$destfile"
  3534.     fi
  3535.  
  3536.     # Do a test to see if this is really a libtool program.
  3537.     if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
  3538.       link_against_libtool_libs=
  3539.       relink_command=
  3540.  
  3541.       # If there is no directory component, then add one.
  3542.       case "$file" in
  3543.       */* | *\\*) . $file ;;
  3544.       *) . ./$file ;;
  3545.       esac
  3546.  
  3547.       # Check the variables that should have been set.
  3548.       if test -z "$link_against_libtool_libs"; then
  3549.         $echo "$modename: invalid libtool wrapper script \`$file'" 1>&2
  3550.         exit 1
  3551.       fi
  3552.  
  3553.       finalize=yes
  3554.       for lib in $link_against_libtool_libs; do
  3555.         # Check to see that each library is installed.
  3556.         libdir=
  3557.         if test -f "$lib"; then
  3558.           # If there is no directory component, then add one.
  3559.           case "$lib" in
  3560.           */* | *\\*) . $lib ;;
  3561.           *) . ./$lib ;;
  3562.           esac
  3563.         fi
  3564.         libfile="$libdir/`$echo "X$lib" | $Xsed -e 's%^.*/%%g'`"
  3565.         if test -n "$libdir" && test ! -f "$libfile"; then
  3566.           $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
  3567.           finalize=no
  3568.         fi
  3569.       done
  3570.  
  3571.       outputname=
  3572.       if test "$fast_install" = no && test -n "$relink_command"; then
  3573.         if test "$finalize" = yes && test -z "$run"; then
  3574.           tmpdir="/tmp"
  3575.           test -n "$TMPDIR" && tmpdir="$TMPDIR"
  3576.           tmpdir="$tmpdir/libtool-$$"
  3577.           if $mkdir -p "$tmpdir" && chmod 700 "$tmpdir"; then :
  3578.           else
  3579.         $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
  3580.         continue
  3581.           fi
  3582.           outputname="$tmpdir/$file"
  3583.           # Replace the output file specification.
  3584.           relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
  3585.  
  3586.           $show "$relink_command"
  3587.           if $run eval "$relink_command"; then :
  3588.           else
  3589.         $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
  3590.         ${rm}r "$tmpdir"
  3591.         continue
  3592.           fi
  3593.           file="$outputname"
  3594.         else
  3595.           $echo "$modename: warning: cannot relink \`$file'" 1>&2
  3596.         fi
  3597.       else
  3598.         # Install the binary that we compiled earlier.
  3599.         file=`$echo "X$file" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
  3600.       fi
  3601.     fi
  3602.  
  3603.     $show "$install_prog$stripme $file $destfile"
  3604.     $run eval "$install_prog\$stripme \$file \$destfile" || exit $?
  3605.     test -n "$outputname" && ${rm}r "$tmpdir"
  3606.     ;;
  3607.       esac
  3608.     done
  3609.  
  3610.     for file in $staticlibs; do
  3611.       name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
  3612.  
  3613.       # Set up the ranlib parameters.
  3614.       oldlib="$destdir/$name"
  3615.  
  3616.       $show "$install_prog $file $oldlib"
  3617.       $run eval "$install_prog \$file \$oldlib" || exit $?
  3618.  
  3619.       # Do each command in the postinstall commands.
  3620.       eval cmds=\"$old_postinstall_cmds\"
  3621.       IFS="${IFS=     }"; save_ifs="$IFS"; IFS='~'
  3622.       for cmd in $cmds; do
  3623.     IFS="$save_ifs"
  3624.     $show "$cmd"
  3625.     $run eval "$cmd" || exit $?
  3626.       done
  3627.       IFS="$save_ifs"
  3628.     done
  3629.  
  3630.     if test -n "$future_libdirs"; then
  3631.       $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
  3632.     fi
  3633.  
  3634.     if test -n "$current_libdirs"; then
  3635.       # Maybe just do a dry run.
  3636.       test -n "$run" && current_libdirs=" -n$current_libdirs"
  3637.       exec $SHELL $0 --finish$current_libdirs
  3638.       exit 1
  3639.     fi
  3640.  
  3641.     exit 0
  3642.     ;;
  3643.  
  3644.   # libtool finish mode
  3645.   finish)
  3646.     modename="$modename: finish"
  3647.     libdirs="$nonopt"
  3648.     admincmds=
  3649.  
  3650.     if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
  3651.       for dir
  3652.       do
  3653.     libdirs="$libdirs $dir"
  3654.       done
  3655.  
  3656.       for libdir in $libdirs; do
  3657.     if test -n "$finish_cmds"; then
  3658.       # Do each command in the finish commands.
  3659.       eval cmds=\"$finish_cmds\"
  3660.       IFS="${IFS=     }"; save_ifs="$IFS"; IFS='~'
  3661.       for cmd in $cmds; do
  3662.         IFS="$save_ifs"
  3663.         $show "$cmd"
  3664.         $run eval "$cmd" || admincmds="$admincmds
  3665.        $cmd"
  3666.       done
  3667.       IFS="$save_ifs"
  3668.     fi
  3669.     if test -n "$finish_eval"; then
  3670.       # Do the single finish_eval.
  3671.       eval cmds=\"$finish_eval\"
  3672.       $run eval "$cmds" || admincmds="$admincmds
  3673.        $cmds"
  3674.     fi
  3675.       done
  3676.     fi
  3677.  
  3678.     # Exit here if they wanted silent mode.
  3679.     test "$show" = : && exit 0
  3680.  
  3681.     echo "----------------------------------------------------------------------"
  3682.     echo "Libraries have been installed in:"
  3683.     for libdir in $libdirs; do
  3684.       echo "   $libdir"
  3685.     done
  3686.     echo
  3687.     echo "If you ever happen to want to link against installed libraries"
  3688.     echo "in a given directory, LIBDIR, you must either use libtool, and"
  3689.     echo "specify the full pathname of the library, or use \`-LLIBDIR'"
  3690.     echo "flag during linking and do at least one of the following:"
  3691.     if test -n "$shlibpath_var"; then
  3692.       echo "   - add LIBDIR to the \`$shlibpath_var' environment variable"
  3693.       echo "     during execution"
  3694.     fi
  3695.     if test -n "$runpath_var"; then
  3696.       echo "   - add LIBDIR to the \`$runpath_var' environment variable"
  3697.       echo "     during linking"
  3698.     fi
  3699.     if test -n "$hardcode_libdir_flag_spec"; then
  3700.       libdir=LIBDIR
  3701.       eval flag=\"$hardcode_libdir_flag_spec\"
  3702.  
  3703.       echo "   - use the \`$flag' linker flag"
  3704.     fi
  3705.     if test -n "$admincmds"; then
  3706.       echo "   - have your system administrator run these commands:$admincmds"
  3707.     fi
  3708.     if test -f /etc/ld.so.conf; then
  3709.       echo "   - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
  3710.     fi
  3711.     echo
  3712.     echo "See any operating system documentation about shared libraries for"
  3713.     echo "more information, such as the ld(1) and ld.so(8) manual pages."
  3714.     echo "----------------------------------------------------------------------"
  3715.     exit 0
  3716.     ;;
  3717.  
  3718.   # libtool execute mode
  3719.   execute)
  3720.     modename="$modename: execute"
  3721.  
  3722.     # The first argument is the command name.
  3723.     cmd="$nonopt"
  3724.     if test -z "$cmd"; then
  3725.       $echo "$modename: you must specify a COMMAND" 1>&2
  3726.       $echo "$help"
  3727.       exit 1
  3728.     fi
  3729.  
  3730.     # Handle -dlopen flags immediately.
  3731.     for file in $execute_dlfiles; do
  3732.       if test ! -f "$file"; then
  3733.     $echo "$modename: \`$file' is not a file" 1>&2
  3734.     $echo "$help" 1>&2
  3735.     exit 1
  3736.       fi
  3737.  
  3738.       dir=
  3739.       case "$file" in
  3740.       *.la)
  3741.     # Check to see that this really is a libtool archive.
  3742.     if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
  3743.     else
  3744.       $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
  3745.       $echo "$help" 1>&2
  3746.       exit 1
  3747.     fi
  3748.  
  3749.     # Read the libtool library.
  3750.     dlname=
  3751.     library_names=
  3752.  
  3753.     # If there is no directory component, then add one.
  3754.     case "$file" in
  3755.     */* | *\\*) . $file ;;
  3756.     *) . ./$file ;;
  3757.     esac
  3758.  
  3759.     # Skip this library if it cannot be dlopened.
  3760.     if test -z "$dlname"; then
  3761.       # Warn if it was a shared library.
  3762.       test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
  3763.       continue
  3764.     fi
  3765.  
  3766.     dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
  3767.     test "X$dir" = "X$file" && dir=.
  3768.  
  3769.     if test -f "$dir/$objdir/$dlname"; then
  3770.       dir="$dir/$objdir"
  3771.     else
  3772.       $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
  3773.       exit 1
  3774.     fi
  3775.     ;;
  3776.  
  3777.       *.lo)
  3778.     # Just add the directory containing the .lo file.
  3779.     dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
  3780.     test "X$dir" = "X$file" && dir=.
  3781.     ;;
  3782.  
  3783.       *)
  3784.     $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
  3785.     continue
  3786.     ;;
  3787.       esac
  3788.  
  3789.       # Get the absolute pathname.
  3790.       absdir=`cd "$dir" && pwd`
  3791.       test -n "$absdir" && dir="$absdir"
  3792.  
  3793.       # Now add the directory to shlibpath_var.
  3794.       if eval "test -z \"\$$shlibpath_var\""; then
  3795.     eval "$shlibpath_var=\"\$dir\""
  3796.       else
  3797.     eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
  3798.       fi
  3799.     done
  3800.  
  3801.     # This variable tells wrapper scripts just to set shlibpath_var
  3802.     # rather than running their programs.
  3803.     libtool_execute_magic="$magic"
  3804.  
  3805.     # Check if any of the arguments is a wrapper script.
  3806.     args=
  3807.     for file
  3808.     do
  3809.       case "$file" in
  3810.       -*) ;;
  3811.       *)
  3812.     # Do a test to see if this is really a libtool program.
  3813.     if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
  3814.       # If there is no directory component, then add one.
  3815.       case "$file" in
  3816.       */* | *\\*) . $file ;;
  3817.       *) . ./$file ;;
  3818.       esac
  3819.  
  3820.       # Transform arg to wrapped name.
  3821.       file="$progdir/$program"
  3822.     fi
  3823.     ;;
  3824.       esac
  3825.       # Quote arguments (to preserve shell metacharacters).
  3826.       file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
  3827.       args="$args \"$file\""
  3828.     done
  3829.  
  3830.     if test -z "$run"; then
  3831.       # Export the shlibpath_var.
  3832.       eval "export $shlibpath_var"
  3833.  
  3834.       # Restore saved enviroment variables
  3835.       if test "${save_LC_ALL+set}" = set; then
  3836.     LC_ALL="$save_LC_ALL"; export LC_ALL
  3837.       fi
  3838.       if test "${save_LANG+set}" = set; then
  3839.     LANG="$save_LANG"; export LANG
  3840.       fi
  3841.  
  3842.       # Now actually exec the command.
  3843.       eval "exec \$cmd$args"
  3844.  
  3845.       $echo "$modename: cannot exec \$cmd$args"
  3846.       exit 1
  3847.     else
  3848.       # Display what would be done.
  3849.       eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
  3850.       $echo "export $shlibpath_var"
  3851.       $echo "$cmd$args"
  3852.       exit 0
  3853.     fi
  3854.     ;;
  3855.  
  3856.   # libtool uninstall mode
  3857.   uninstall)
  3858.     modename="$modename: uninstall"
  3859.     rm="$nonopt"
  3860.     files=
  3861.  
  3862.     for arg
  3863.     do
  3864.       case "$arg" in
  3865.       -*) rm="$rm $arg" ;;
  3866.       *) files="$files $arg" ;;
  3867.       esac
  3868.     done
  3869.  
  3870.     if test -z "$rm"; then
  3871.       $echo "$modename: you must specify an RM program" 1>&2
  3872.       $echo "$help" 1>&2
  3873.       exit 1
  3874.     fi
  3875.  
  3876.     for file in $files; do
  3877.       dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
  3878.       test "X$dir" = "X$file" && dir=.
  3879.       name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
  3880.  
  3881.       rmfiles="$file"
  3882.  
  3883.       case "$name" in
  3884.       *.la)
  3885.     # Possibly a libtool archive, so verify it.
  3886.     if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
  3887.       . $dir/$name
  3888.  
  3889.       # Delete the libtool libraries and symlinks.
  3890.       for n in $library_names; do
  3891.         rmfiles="$rmfiles $dir/$n"
  3892.         test "X$n" = "X$dlname" && dlname=
  3893.       done
  3894.       test -n "$dlname" && rmfiles="$rmfiles $dir/$dlname"
  3895.       test -n "$old_library" && rmfiles="$rmfiles $dir/$old_library"
  3896.  
  3897.       $show "$rm $rmfiles"
  3898.       $run $rm $rmfiles
  3899.  
  3900.       if test -n "$library_names"; then
  3901.         # Do each command in the postuninstall commands.
  3902.         eval cmds=\"$postuninstall_cmds\"
  3903.         IFS="${IFS=     }"; save_ifs="$IFS"; IFS='~'
  3904.         for cmd in $cmds; do
  3905.           IFS="$save_ifs"
  3906.           $show "$cmd"
  3907.           $run eval "$cmd"
  3908.         done
  3909.         IFS="$save_ifs"
  3910.       fi
  3911.  
  3912.       if test -n "$old_library"; then
  3913.         # Do each command in the old_postuninstall commands.
  3914.         eval cmds=\"$old_postuninstall_cmds\"
  3915.         IFS="${IFS=     }"; save_ifs="$IFS"; IFS='~'
  3916.         for cmd in $cmds; do
  3917.           IFS="$save_ifs"
  3918.           $show "$cmd"
  3919.           $run eval "$cmd"
  3920.         done
  3921.         IFS="$save_ifs"
  3922.       fi
  3923.  
  3924.       # FIXME: should reinstall the best remaining shared library.
  3925.     fi
  3926.     ;;
  3927.  
  3928.       *.lo)
  3929.     if test "$build_old_libs" = yes; then
  3930.       oldobj=`$echo "X$name" | $Xsed -e "$lo2o"`
  3931.       rmfiles="$rmfiles $dir/$oldobj"
  3932.     fi
  3933.     $show "$rm $rmfiles"
  3934.     $run $rm $rmfiles
  3935.     ;;
  3936.  
  3937.       *)
  3938.     $show "$rm $rmfiles"
  3939.     $run $rm $rmfiles
  3940.     ;;
  3941.       esac
  3942.     done
  3943.     exit 0
  3944.     ;;
  3945.  
  3946.   "")
  3947.     $echo "$modename: you must specify a MODE" 1>&2
  3948.     $echo "$generic_help" 1>&2
  3949.     exit 1
  3950.     ;;
  3951.   esac
  3952.  
  3953.   $echo "$modename: invalid operation mode \`$mode'" 1>&2
  3954.   $echo "$generic_help" 1>&2
  3955.   exit 1
  3956. fi # test -z "$show_help"
  3957.  
  3958. # We need to display help for each of the modes.
  3959. case "$mode" in
  3960. "") $echo \
  3961. "Usage: $modename [OPTION]... [MODE-ARG]...
  3962.  
  3963. Provide generalized library-building support services.
  3964.  
  3965.     --config          show all configuration variables
  3966.     --debug           enable verbose shell tracing
  3967. -n, --dry-run         display commands without modifying any files
  3968.     --features        display basic configuration information and exit
  3969.     --finish          same as \`--mode=finish'
  3970.     --help            display this help message and exit
  3971.     --mode=MODE       use operation mode MODE [default=inferred from MODE-ARGS]
  3972.     --quiet           same as \`--silent'
  3973.     --silent          don't print informational messages
  3974.     --version         print version information
  3975.  
  3976. MODE must be one of the following:
  3977.  
  3978.       compile         compile a source file into a libtool object
  3979.       execute         automatically set library path, then run a program
  3980.       finish          complete the installation of libtool libraries
  3981.       install         install libraries or executables
  3982.       link            create a library or an executable
  3983.       uninstall       remove libraries from an installed directory
  3984.  
  3985. MODE-ARGS vary depending on the MODE.  Try \`$modename --help --mode=MODE' for
  3986. a more detailed description of MODE."
  3987.   exit 0
  3988.   ;;
  3989.  
  3990. compile)
  3991.   $echo \
  3992. "Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
  3993.  
  3994. Compile a source file into a libtool library object.
  3995.  
  3996. This mode accepts the following additional options:
  3997.  
  3998.   -o OUTPUT-FILE    set the output file name to OUTPUT-FILE
  3999.   -static           always build a \`.o' file suitable for static linking
  4000.  
  4001. COMPILE-COMMAND is a command to be used in creating a \`standard' object file
  4002. from the given SOURCEFILE.
  4003.  
  4004. The output file name is determined by removing the directory component from
  4005. SOURCEFILE, then substituting the C source code suffix \`.c' with the
  4006. library object suffix, \`.lo'."
  4007.   ;;
  4008.  
  4009. execute)
  4010.   $echo \
  4011. "Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
  4012.  
  4013. Automatically set library path, then run a program.
  4014.  
  4015. This mode accepts the following additional options:
  4016.  
  4017.   -dlopen FILE      add the directory containing FILE to the library path
  4018.  
  4019. This mode sets the library path environment variable according to \`-dlopen'
  4020. flags.
  4021.  
  4022. If any of the ARGS are libtool executable wrappers, then they are translated
  4023. into their corresponding uninstalled binary, and any of their required library
  4024. directories are added to the library path.
  4025.  
  4026. Then, COMMAND is executed, with ARGS as arguments."
  4027.   ;;
  4028.  
  4029. finish)
  4030.   $echo \
  4031. "Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
  4032.  
  4033. Complete the installation of libtool libraries.
  4034.  
  4035. Each LIBDIR is a directory that contains libtool libraries.
  4036.  
  4037. The commands that this mode executes may require superuser privileges.  Use
  4038. the \`--dry-run' option if you just want to see what would be executed."
  4039.   ;;
  4040.  
  4041. install)
  4042.   $echo \
  4043. "Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
  4044.  
  4045. Install executables or libraries.
  4046.  
  4047. INSTALL-COMMAND is the installation command.  The first component should be
  4048. either the \`install' or \`cp' program.
  4049.  
  4050. The rest of the components are interpreted as arguments to that command (only
  4051. BSD-compatible install options are recognized)."
  4052.   ;;
  4053.  
  4054. link)
  4055.   $echo \
  4056. "Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
  4057.  
  4058. Link object files or libraries together to form another library, or to
  4059. create an executable program.
  4060.  
  4061. LINK-COMMAND is a command using the C compiler that you would use to create
  4062. a program from several object files.
  4063.  
  4064. The following components of LINK-COMMAND are treated specially:
  4065.  
  4066.   -all-static       do not do any dynamic linking at all
  4067.   -avoid-version    do not add a version suffix if possible
  4068.   -dlopen FILE      \`-dlpreopen' FILE if it cannot be dlopened at runtime
  4069.   -dlpreopen FILE   link in FILE and add its symbols to lt_preloaded_symbols
  4070.   -export-dynamic   allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
  4071.   -export-symbols SYMFILE
  4072.             try to export only the symbols listed in SYMFILE
  4073.   -export-symbols-regex REGEX
  4074.             try to export only the symbols matching REGEX
  4075.   -LLIBDIR          search LIBDIR for required installed libraries
  4076.   -lNAME            OUTPUT-FILE requires the installed library libNAME
  4077.   -module           build a library that can dlopened
  4078.   -no-undefined     declare that a library does not refer to external symbols
  4079.   -o OUTPUT-FILE    create OUTPUT-FILE from the specified objects
  4080.   -release RELEASE  specify package release information
  4081.   -rpath LIBDIR     the created library will eventually be installed in LIBDIR
  4082.   -R[ ]LIBDIR       add LIBDIR to the runtime path of programs and libraries
  4083.   -static           do not do any dynamic linking of libtool libraries
  4084.   -version-info CURRENT[:REVISION[:AGE]]
  4085.             specify library version info [each variable defaults to 0]
  4086.  
  4087. All other options (arguments beginning with \`-') are ignored.
  4088.  
  4089. Every other argument is treated as a filename.  Files ending in \`.la' are
  4090. treated as uninstalled libtool libraries, other files are standard or library
  4091. object files.
  4092.  
  4093. If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
  4094. only library objects (\`.lo' files) may be specified, and \`-rpath' is
  4095. required, except when creating a convenience library.
  4096.  
  4097. If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
  4098. using \`ar' and \`ranlib', or on Windows using \`lib'.
  4099.  
  4100. If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
  4101. is created, otherwise an executable program is created."
  4102.   ;;
  4103.  
  4104. uninstall)
  4105.   $echo \
  4106. "Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
  4107.  
  4108. Remove libraries from an installation directory.
  4109.  
  4110. RM is the name of the program to use to delete files associated with each FILE
  4111. (typically \`/bin/rm').  RM-OPTIONS are options (such as \`-f') to be passed
  4112. to RM.
  4113.  
  4114. If FILE is a libtool library, all the files associated with it are deleted.
  4115. Otherwise, only FILE itself is deleted using RM."
  4116.   ;;
  4117.  
  4118. *)
  4119.   $echo "$modename: invalid operation mode \`$mode'" 1>&2
  4120.   $echo "$help" 1>&2
  4121.   exit 1
  4122.   ;;
  4123. esac
  4124.  
  4125. echo
  4126. $echo "Try \`$modename --help' for more information about other modes."
  4127.  
  4128. exit 0
  4129.  
  4130. # Local Variables:
  4131. # mode:shell-script
  4132. # sh-indentation:2
  4133. # End:
  4134.